Update of /project/elephant/cvsroot/elephant/src/db-acache In directory common-lisp:/tmp/cvs-serv12650/src/db-acache
Modified Files: README acache-collections.lisp acache-controller.lisp Log Message:
Migration tests pass on BDB. Only migrate ipclass failes under SQLite 3 (May be due to other current failures under SQLite 3) Significant improvements in transaction stability, stability with mutiple open stores, bdb processing speed, and various bug fixes turned up by getting these tests to pass.
--- /project/elephant/cvsroot/elephant/src/db-acache/README 2006/02/20 21:21:41 1.1 +++ /project/elephant/cvsroot/elephant/src/db-acache/README 2006/02/21 19:40:02 1.2 @@ -1,6 +1,14 @@
- This directory contains a quick and dirty sketch of an allegrocache -backend, mostly to test out the new backend abstraction. Too bad we -can't use allegroserve directly behind the metaclass protocol...the -apis are a little too different for that. +backend, mostly to test out the new backend abstraction. + +Basic btrees work fine but iteration (cursors) are very limited. +I think the best way to go is reverse engineer the db.btree API +and just implement the elephant backend on top of that API. I +may do this at some point, but not today... + +Or better yet, find someone willing to write a btree library in +lisp. John Fedaro said it wasn't a huge amount of work and can +be done with very high performance in all Common Lisp. + +Ian --- /project/elephant/cvsroot/elephant/src/db-acache/acache-collections.lisp 2006/02/20 21:21:41 1.1 +++ /project/elephant/cvsroot/elephant/src/db-acache/acache-collections.lisp 2006/02/21 19:40:02 1.2 @@ -26,11 +26,32 @@ (defmethod map-btree (fn (bt acache-btree)) (map-map fn bt))
+ + +;; INDEXED BTREE + +(defclass acache-indexed-btree (indexed-btree acache-btree) + ((indices :accessor indices :initarg :indices :initform (make-hash-table)) + (indices-cache :accessor indices-cache :initarg :indicies-cache :initform nil :transient t)) + (:metaclass persistent-metaclass)) + +(defmethod build-indexed-btree ((sc acache-store-controller)) + (make-instance 'acache-indexed-btree :sc sc)) + +(defclass acache-btree-index (btree-index acache-btree) + () + (:metaclass persistent-metaclass)) + +(defmethod build-btree-index ((sc acache-store-controller) &key primary key-form) + (make-instance 'acache-btree-index :primary primary :key-form :sc sc)) + ;; -;; Cursors need to have their own model of where they are +;; CURSORS ;;
-;; INDEXED BTREE +(defclass acache-cursor (cursor) + ()) + +(defmethod make-cursor ((bt acache-btree)) + (make-instance 'acache-cursor))
-;; How to handle add-index? Have to hack it up on btrees just like slot -;; values...which means solving the complex key problem \ No newline at end of file --- /project/elephant/cvsroot/elephant/src/db-acache/acache-controller.lisp 2006/02/20 21:21:41 1.1 +++ /project/elephant/cvsroot/elephant/src/db-acache/acache-controller.lisp 2006/02/21 19:40:02 1.2 @@ -51,9 +51,7 @@
(defmethod next-oid ((sc acache-store-controller)) - (db.allegrocache:with-transaction-restart () - (incf (oid-record-counter (controller-oidrec sc))) - (commit))) + (incf (oid-record-counter (controller-oidrec sc))))
(defmethod close-controller ((sc acache-store-controller)) ;; Ensure deletion of common