Source
(defmethod initialize-instance :after ((cache standard-cache)
&key
directory
(heap-class 'mark-and-sweep-heap)
(heap-options '())
(if-exists :overwrite)
(if-does-not-exist :create)
(size 100000)
&allow-other-keys)
(ensure-directories-exist directory)
(let ((object-table (open-object-table (merge-pathnames "objects" directory)
:if-exists if-exists
:if-does-not-exist if-does-not-exist)))
(setf (cache-size cache) size)
(with-slots (heap schema-table objects)
cache
(setq heap (open-heap (merge-pathnames "heap" directory)
:class heap-class
:if-exists if-exists
:if-does-not-exist if-does-not-exist
:rucksack (rucksack cache)
:options (list* :object-table object-table
heap-options))
schema-table (open-schema-table (merge-pathnames "schemas" directory)
:if-exists if-exists
:if-does-not-exist if-does-not-exist)
objects (make-hash-table :size size))
(when (and (eql if-exists :overwrite) (probe-file (commit-filename cache)))
;; We're trying to work with an existing cache but the
;; commit file exists, so there may be a partially committed
;; transaction that we need to undo.
(cache-recover cache)))))
Source Context