Common Lisp Package: RUCKSACK

README:

FUNCTION

Public

DEFINE-INDEX-SPEC (NAME SPEC &KEY (IF-EXISTS OVERWRITE))

NAME must be a keyword. SPEC must be an index spec. IF-EXISTS must be either :OVERWRITE (default) or :ERROR.

OPEN-RUCKSACK (DIRECTORY-DESIGNATOR &REST ARGS &KEY (CLASS 'SERIAL-TRANSACTION-RUCKSACK) (IF-EXISTS OVERWRITE) (IF-DOES-NOT-EXIST CREATE) (CACHE-CLASS 'LAZY-CACHE) (CACHE-ARGS 'NIL) &ALLOW-OTHER-KEYS)

Opens the rucksack in the directory designated by DIRECTORY-DESIGNATOR. :IF-DOES-NOT-EXIST can be either :CREATE (creates a new rucksack if the it does not exist; this is the default) or :ERROR (signals an error if the rucksack does not exist). :IF-EXISTS can be either :OVERWRITE (loads the rucksack if it exists; this is the default), :SUPERSEDE (deletes the existing rucksack and creates a new empty rucksack) or :ERROR (signals an error if the rucksack exists).

P-CAAR (OBJECT)

The persistent equivalent of CAAR.

P-CADR (OBJECT)

The persistent equivalenet of CADR.

P-CDAR (OBJECT)

The persistent equivalent of CDAR.

P-CDDR (OBJECT)

The persistent equivalent of CDDR.

P-LAST (LIST &OPTIONAL (N 1))

Returns the last persistent cons cell of a persistent list (or NIL if the list is empty).

TRANSACTION-COMMIT (TRANSACTION &KEY (RUCKSACK (CURRENT-RUCKSACK)))

Call transaction-commit-1 to do the real work.

UNWRAP-PERSISTENT-LIST (LIST)

Converts a persistent list to a 'normal' Lisp list.

Undocumented

ADD-CLASS-INDEX (CLASS-DESIGNATOR &KEY ERRORP)

ADD-SLOT-INDEX (CLASS-DESIGNATOR SLOT INDEX-SPEC &KEY (ERRORP NIL))

CACHE (OBJECT)

CLOSE-RUCKSACK (RUCKSACK &KEY (COMMIT T))

COMMIT (&KEY (RUCKSACK (CURRENT-RUCKSACK)))

CURRENT-RUCKSACK

CURRENT-TRANSACTION

FIND-INDEX-SPEC (NAME &KEY (ERRORP T))

INTERNAL-RUCKSACK-ERROR (FORMAT-STRING &REST FORMAT-ARGS)

MAKE-INDEX (INDEX-SPEC UNIQUE-KEYS-P &KEY (CLASS 'INDEX))

MAP-CLASS-INDEXES (FUNCTION)

MAP-SLOT-INDEXES (FUNCTION &KEY (CLASS T) (INCLUDE-SUBCLASSES T))

OPEN-CACHE (DIRECTORY &REST ARGS &KEY (CLASS 'STANDARD-CACHE) &ALLOW-OTHER-KEYS)

OPEN-HEAP (PATHNAME &KEY (CLASS 'HEAP) RUCKSACK (OPTIONS 'NIL) (IF-EXISTS OVERWRITE) (IF-DOES-NOT-EXIST CREATE))

P-CONS (CAR CDR)

P-LIST (&REST OBJECTS)

P-MAKE-ARRAY (DIMENSIONS &REST OPTIONS &KEY &ALLOW-OTHER-KEYS)

P-MAPC (FUNCTION LIST)

P-MAPCAR (FUNCTION LIST)

P-MAPL (FUNCTION LIST)

P-MAPLIST (FUNCTION LIST)

P-MEMBER-IF (PREDICATE LIST &KEY KEY)

REMOVE-CLASS-INDEX (CLASS-DESIGNATOR &KEY (ERRORP NIL))

REMOVE-SLOT-INDEX (CLASS-DESIGNATOR SLOT &KEY (ERRORP NIL))

ROLLBACK (&KEY (RUCKSACK (CURRENT-RUCKSACK)))

RUCKSACK-ERROR (CLASS &REST ARGS)

SIMPLE-RUCKSACK-ERROR (FORMAT-STRING &REST FORMAT-ARGS)

TRANSACTION-ROLLBACK (TRANSACTION &KEY (RUCKSACK (CURRENT-RUCKSACK)))

TRANSACTION-START (&REST ARGS &KEY (RUCKSACK (CURRENT-RUCKSACK)) &ALLOW-OTHER-KEYS)

Private

ANALYZE-LIST (X)

Returns two values. The first value is one of :PROPER-LIST, :DOTTED-LIST or :CIRCULAR-LIST. The second value is the length of the list. For dotted lists, the final item is included in the length; for circular lists, the length is NIL.

BIGGEST-KEY (NODE)

Returns the biggest key in this node or any of its subnodes.

BINDING-KEY (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

BINDING-VALUE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

CHECK-BNODE-KEYS (TREE NODE)

Check a btree node (and its descendants) for consistency. This is only used for debugging.

COMPARE-SLOTS (OLD-SLOTS SLOTS)

Returns three values: a list of added slots, a list of discarded slots and a list of changed (according to SLOT-DEFINITION-EQUAL) slots.

CREATE-COMMIT-FILE (TRANSACTION CACHE)

Write object ids of all dirty objects to the commit file, so recovery can do its job if this transaction never completes.

DELETE-OBJECT-ID (OBJECT-TABLE OBJECT-ID)

Returns object-id's cell to the free-list.

DESERIALIZE (SERIALIZER &OPTIONAL (EOF-ERROR-P T) (EOF-VALUE NIL))

Reads the next object from the serializer stream. Signals an end-of-file error or returns EOF-VALUE when the end of the stream is reached.

DESERIALIZE-DOTTED-LIST (STREAM)

Serializes a dotted list by first serializing its length and then all the elements of the list.

DISTRIBUTE-ELEMENTS (BTREE LEFT-NODE RIGHT-NODE PARENT)

One of LEFT-NODE and RIGHT-NODE doesn't have enough elements, but the union of both has enough elements for two nodes, so we redistribute the elements between the two nodes.

FIND-COMMITTED-OBJECT-VERSION (OBJECT-ID CURRENT-TRANSACTION-ID HEAP)

Returns the buffer, id, nr-slots and schema-id of the object containing the compatible version for the given transaction id. The buffer points to the first octet after the standard object fields. As a fifth value, it returns a boolean that's true when the object version is the most recent committed object version (i.e. in the head of the object version list).

FIND-KEY-IN-NODE (BTREE NODE KEY)

Tries to find a binding with the given key in a bnode. If it succeeds, it returns the binding (and, as a second value, the position of that binding). Otherwise it returns NIL.

FIND-OBJECT-VERSION (OBJECT-ID CURRENT-TRANSACTION CACHE)

Returns the object version for OBJECT-ID that's compatible with CURRENT-TRANSACTION, or NIL if there's no such version in the cache memory.

FIND-SUBNODE (BTREE NODE KEY)

Returns the subnode that contains more information for the given key.

FIND-VALUE-IN-NODE (BTREE NODE VALUE &KEY (TEST (BTREE-VALUE= BTREE)))

Tries to find a binding with the given value in a bnode. If it succeeds, it returns the binding (and, as a second value, the position of that binding). Otherwise it returns NIL.

FREE-LIST-POINTER (SIZE-CLASS)

Returns a pointer to the cell containing the free list start.

IMPORT-RUCKSACK (PATHNAME DIRECTORY-DESIGNATOR &REST ARGS &KEY (IF-EXISTS ERROR) &ALLOW-OTHER-KEYS)

Creates a new rucksack in the directory specified by DIRECTORY-DESIGNATOR, opens the new rucksack and imports all objects that were exported to the file specified by PATHNAME.

INDEX-SPEC-EQUAL (INDEX-SPEC-1 INDEX-SPEC-2)

Returns T iff two index specs are equal.

JOIN-NODES (BTREE LEFT-NODE RIGHT-NODE PARENT-STACK)

Create one node which contains the elements of both LEFT-NODE and RIGHT-NODE.

KEY-POSITION (BTREE NODE KEY)

Tries to find a binding with the given key in a bnode. If it succeeds, it returns the position of that binding. Otherwise, it returns NIL.

LOAD-COMMIT-FILE (CACHE)

Returns two values: a transaction id and a list of object ids (of objects that may be partially committed).

LOAD-OBJECT-FIELDS (BUFFER OBJECT-ID)

Returns id, nr-slots, schema-id, transaction-id and prev-version (as 5 values).

LOAD-OBJECTS (PATHNAME)

Returns a list of objects from a file created by SAVE-OBJECTS.

MAX-CHARACTER-CODE (STRING)

Returns the highest character code in string.

NEW-OBJECT-ID (OBJECT-TABLE)

Returns an OBJECT-ID that is not in use.

NODE-POSITION (NODE PARENT BTREE)

Returns the position of NODE (as a binding value) in a parent node.

OBJECT-INFO (OBJECT-TABLE ID)

Returns either :free-block, :dead-object, :live-object or :reserved.

OBJECT-TABLE-SIZE (OBJECT-TABLE)

Returns the potential number of objects in an object-table. The first potential object-id is number 0.

SETFOBJECT-VERSION-LIST (OLD-BLOCK YOUNG-BLOCK HEAP)

Let the (previous pointer of the) object in YOUNG-BLOCK point to OLD-BLOCK.

OPEN-SERIALIZER (STREAM)

Creates and returns a serializer for a stream. The stream must have element-type (UNSIGNED-BYTE 8)).

POSITION-OF-BINDING-WITH-GREATER-KEY (BTREE NODE KEY)

Returns the position of the first binding in NODE with a key greater than KEY. Returns nil if there is no such binding.

REPLACE-BINDINGS (VECTOR-1 VECTOR-2 &KEY (START1 0) END1 (START2 0) END2)

Like P-REPLACE, but for vectors with bindings instead of plain vectors (so all indexes must be multiplied by 2).

RUCKSACK-FILES-IN-DIRECTORY (DIRECTORY-PATHNAME)

Returns a list with the pathnames of all Rucksack files in the specified directory.

RUCKSACK-INDEXED-SLOTS-FOR-CLASS (RUCKSACK CLASS)

Returns a list with the names of the indexed direct slots of CLASS.

SANS (PLIST &REST KEYS)

Returns PLIST with keyword arguments from KEYS removed.

SAVE-OBJECTS (OBJECTS PATHNAME)

Saves a list with objects to a file, creating the file if necessary. If the file exists, it will be superseded.

SERIALIZE-DOTTED-LIST (LIST STREAM &OPTIONAL (LENGTH (LENGTH LIST)))

Serializes a dotted list by first serializing its length and then all the elements of the list.

SERIALIZE-LIST (LIST STREAM &OPTIONAL (LENGTH (LENGTH LIST)))

Serializes a proper list by first serializing its length and then all the elements of the list.

SLOT-DEF-AND-NAME (CLASS SLOT-NAME-OR-DEF)

Returns (1) slot definition and (2) slot name.

SMALLEST-KEY (NODE)

Returns the smallest key in this node or any of its subnodes.

SPLIT-BNODE (BTREE NODE PARENT-STACK KEY)

The node is (almost) full. Create two new nodes and divide the current node-index over these two new nodes.

VERSION-LIST-POSITION (CURRENT-TRANSACTION-ID OBJ-ID VERSION-LIST HEAP)

Returns the correct position for a transaction-id in a version-list. To be more precise, it returns: 1. the block of the object version with the oldest transaction that's younger than the given transaction-id (nil if there is no such version). 2. the block of the first object version in the version list that has a transaction id older than the given transaction-id (nil if there is no such version). VERSION-LIST is either nil or the heap position of the first object version in the version list.

Undocumented

ADD-AND-FILL-SLOT-INDEX (RUCKSACK CLASS SLOT INDEX-SPEC UNIQUE-P)

ADD-RUCKSACK-ROOT-ID (OBJECT-ID RUCKSACK)

SETFBINDING-KEY (NEW-VALUE INSTANCE)

BINDING-P (OBJECT)

SETFBINDING-VALUE (NEW-VALUE INSTANCE)

BLOCK-TO-OBJECT-ID (BLOCK OBJECT-TABLE)

BTREE-AS-CONS (BTREE)

CHECK-BTREE (BTREE)

CHECK-NODE (BTREE NODE)

CHECK-P-VECTOR (PERSISTENT-ARRAY FUNCTION-NAME)

CLOSE-OBJECT-TABLE (OBJECT-TABLE)

CLOSE-SCHEMA-TABLE (TABLE &KEY (COMMIT T))

CLOSE-SERIALIZER (SERIALIZER &KEY ABORT)

COMMIT-FILENAME (CACHE)

COPY-BINDING (INSTANCE)

COPY-SLOT-DEFINITION (SLOT-DEF)

DELETE-COMMIT-FILE (TRANSACTION CACHE)

DESERIALIZE-BYTE-16 (STREAM)

DESERIALIZE-BYTE-24 (STREAM)

DESERIALIZE-BYTE-32 (STREAM)

DESERIALIZE-BYTE-48 (STREAM)

DESERIALIZE-BYTE-64 (STREAM)

DESERIALIZE-LIST (STREAM)

DESERIALIZE-STRING (SIMPLE-P CHARACTER-CODE-READER STREAM)

DISPLAY-NODE (NODE)

ENLARGE-NODE (BTREE NODE PARENT-STACK)

FIND-OLD-INDEX-SPEC (SLOT-NAME OLD-SLOTS)

FORCE-SERIALIZER-OUTPUT (SERIALIZER)

INSERT-NEW-BINDING (NODE POSITION KEY VALUE)

LEAF-DELETE-KEY (BTREE LEAF PARENT-STACK KEY IF-DOES-NOT-EXIST)

LEAF-INSERT (BTREE LEAF PARENT-STACK KEY VALUE IF-EXISTS)

LOAD-ROOTS (RUCKSACK)

MAKE-BINDING (&KEY ((KEY DUM326) NIL) ((VALUE DUM327) NIL))

MAKE-LEAF-VALUE (BTREE VALUE)

MAKE-LOCK (&KEY (NAME lock))

MAKE-PERSISTENT-DATA (CLASS CONTENTS &OPTIONAL (RUCKSACK (CURRENT-RUCKSACK)))

MAKE-ROOT (BTREE LEFT-KEY LEFT-SUBNODE RIGHT-KEY RIGHT-SUBNODE)

MAYBE-ADD-PERSISTENT-OBJECT-CLASS (CLASS DIRECT-SUPERCLASSES)

MAYBE-UPDATE-SLOT-INFO (CLASS)

NODE-AS-CONS (NODE &OPTIONAL (UNIQUE-KEYS T))

NODE-BINDING (NODE I)

SETFNODE-BINDING (BINDING NODE I)

NODE-BINDING-KEY (NODE I)

SETFNODE-BINDING-KEY (KEY NODE I)

NODE-BINDING-VALUE (NODE I)

SETFNODE-BINDING-VALUE (VALUE NODE I)

NODE-FULL-ENOUGH-P (BTREE NODE)

NODE-FULL-P (BTREE NODE)

NODE-HAS-MIN-SIZE-P (BTREE NODE)

NOT-FOUND (BTREE KEY ERRORP DEFAULT-VALUE)

NOT-IMPLEMENTED (OPERATOR)

NR-OCTETS (N)

OBJECT-ALIVE-P (OBJECT-TABLE OBJECT-ID)

SETFOBJECT-ALIVE-P (VALUE OBJECT-TABLE OBJECT-ID)

OBJECT-HEAP-POSITION (OBJECT-TABLE ID)

SETFOBJECT-HEAP-POSITION (POSITION OBJECT-TABLE ID)

OBJECT-ID-TO-BLOCK (ID OBJECT-TABLE)

SETFOBJECT-INFO (INFO OBJECT-TABLE ID)

OPEN-OBJECT-TABLE (PATHNAME &KEY (IF-EXISTS OVERWRITE) (IF-DOES-NOT-EXIST CREATE))

OPEN-SCHEMA-TABLE (PATHNAME &KEY IF-EXISTS IF-DOES-NOT-EXIST)

POINTER-VALUE (POINTER HEAP)

SETFPOINTER-VALUE (VALUE POINTER HEAP)

PROCESS-LOCK (LOCK)

PROCESS-UNLOCK (LOCK)

READ-BLOCK-START (HEAP POSITION)

READ-UNSIGNED-BYTES (BUFFER STREAM &OPTIONAL (NR-OCTETS +POINTER-SIZE+))

REMOVE-KEY (BTREE NODE KEY)

REPLACE-SLOT-INDEX (RUCKSACK CLASS SLOT INDEX-SPEC UNIQUE-P)

RUCKSACK-DELETE-OBJECTS (RUCKSACK OBJECTS)

RUCKSACK-LIST-CLASS-INDEXES (RUCKSACK)

RUCKSACK-LIST-SLOT-INDEXES (RUCKSACK)

SAVE-ROOTS (RUCKSACK)

SAVE-ROOTS-IF-NECESSARY (RUCKSACK)

SCAN-BYTE-16 (STREAM &OPTIONAL GC)

SCAN-BYTE-24 (STREAM &OPTIONAL GC)

SCAN-BYTE-32 (STREAM &OPTIONAL GC)

SCAN-BYTE-48 (STREAM &OPTIONAL GC)

SCAN-BYTE-64 (STREAM &OPTIONAL GC)

SCAN-LIST (STREAM GC)

SCAN-STRING (SIMPLE-P CHARACTER-CODE-SCANNER STREAM GC)

SERIALIZE-BYTE-16 (INTEGER STREAM)

SERIALIZE-BYTE-24 (INTEGER STREAM)

SERIALIZE-BYTE-32 (INTEGER STREAM)

SERIALIZE-BYTE-48 (INTEGER STREAM)

SERIALIZE-BYTE-64 (INTEGER STREAM)

SERIALIZE-FLOAT (NUMBER STREAM)

SERIALIZE-INTEGER (POSITIVE-P UNSIGNED NR-OCTETS STREAM)

SERIALIZE-MARKER (MARKER SERIALIZER)

SERIALIZE-PREVIOUS-VERSION-POINTER (PREVIOUS-POINTER STREAM)

SERIALIZE-STANDARD-OBJECT (OBJECT SERIALIZER)

SERIALIZE-STRUCTURE-OBJECT (OBJECT SERIALIZER)

SHORTEN (NODE NEW-LENGTH)

SLOT-DEFINITION-EQUAL (SLOT-1 SLOT-2)

TEST-ANALYZE-LIST

TEST-GARBAGE-COLLECTOR (RUCKSACK)

TRIM-WHITESPACE (STRING)

UPDATE-INDEXES (CLASS)

UPDATE-NODE-BINDING (NODE I KEY VALUE)

UPDATE-PARENTS-FOR-DELETED-KEY (BTREE PARENT-STACK OLD-KEY NEW-KEY)

UPDATE-SLOT-INFO (CLASS)

WRITE-UNSIGNED-BYTES (INTEGER BUFFER STREAM &OPTIONAL (NR-OCTETS +POINTER-SIZE+))

MACRO

Public

P-POP (PLACE &ENVIRONMENT ENV)

Pop an item from the persistent list specified by PLACE.

P-PUSH (ITEM PLACE &ENVIRONMENT ENV)

Push ITEM onto the persistent list specified by PLACE. Return the modified persistent list. ITEM is evaluated before place.

RUCKSACK-DO-CLASS ((INSTANCE-VAR CLASS &KEY (RUCKSACK '*RUCKSACK*) ID-ONLY (INCLUDE-SUBCLASSES T)) &BODY BODY)

Evaluate BODY for each instance of CLASS, with INSTANCE-VAR successively bound to each instance. See the documentation of RUCKSACK-MAP-CLASS for more details.

RUCKSACK-DO-SLOT ((INSTANCE-VAR CLASS SLOT &REST ARGS &KEY (RUCKSACK '*RUCKSACK*) EQUAL MIN MAX INCLUDE-MIN INCLUDE-MAX ORDER INCLUDE-SUBCLASSES) &BODY BODY)

Evaluate BODY for each instance of CLASS where SLOT has the specified value. INSTANCE-VAR will be bound successively to each instance. See the documentation of RUCKSACK-MAP-SLOT for more details.

Undocumented

WITH-CACHE ((CACHE DIRECTORY &REST OPTIONS) &BODY BODY)

WITH-RUCKSACK ((RUCKSACK DIRECTORY &REST ARGS) &BODY BODY)

WITH-TRANSACTION ((&REST ARGS &KEY (RUCKSACK '(CURRENT-RUCKSACK)) (INHIBIT-GC NIL INHIBIT-GC-SUPPLIED-P) &ALLOW-OTHER-KEYS) &BODY BODY)

Private

Undocumented

WITH-ALLOCATION-COUNTER ((HEAP) &BODY BODY)

WITH-LOCK ((LOCK) &BODY BODY)

WITHOUT-RUCKSACK-GCING (&BODY BODY)

GENERIC-FUNCTION

Public

ADD-RUCKSACK-ROOT (OBJECT RUCKSACK)

Adds an object to the root set of a rucksack.

BTREE-DELETE (BTREE KEY VALUE &KEY IF-DOES-NOT-EXIST (IF-DOES-NOT-EXIST IGNORE))

Removes an association from KEY to VALUE from a btree. IF-DOES-NOT-EXIST can be either :IGNORE (default) or :ERROR. If there is no association from KEY to VALUE and IF-DOES-NOT-EXIST is :ERROR, a BTREE-DELETION-ERROR is signaled.

BTREE-DELETE-KEY (BTREE KEY &KEY IF-DOES-NOT-EXIST (IF-DOES-NOT-EXIST IGNORE))

Removes KEY and all associated values from a btree. IF-DOES-NOT-EXIST can be either :IGNORE (default) or :ERROR. For a btree with unique-keys that contains a value for KEY, this operation is identical to (btree-delete btree key (btree-search btree key)) For a btree with non-unique keys, it's identical to (dolist (value (unwrap-persistent-list (btree-search btree key))) (btree-delete btree key value))

BTREE-INSERT (BTREE KEY VALUE &KEY IF-EXISTS (IF-EXISTS OVERWRITE))

Adds an association from KEY to VALUE to a btree. IF-EXISTS can be either :OVERWRITE (default) or :ERROR. If the btree has unique keys (see BTREE-UNIQUE-KEYS-P) and KEY is already associated with another (according to BTREE-VALUE=) value, the result depends on the IF-EXISTS option: if IF-EXISTS is :OVERWRITE, the old value is overwriten; if IF-EXISTS is :ERROR, a BTREE-KEY-ALREADY-PRESENT-ERROR is signaled. For btrees with non-unique keys, the IF-EXISTS option is ignored and VALUE is just added to the list of values associated with KEY (unless VALUE is already associated with KEY; in that case nothing happens).

BTREE-NR-KEYS (BTREE)

Returns the number of keys in a btree.

BTREE-NR-VALUES (BTREE)

Returns the number of values in a btree.

CACHE-COMMIT (CACHE)

Makes sure that all changes to the cache are written to disk.

CACHE-COUNT (CACHE)

Returns the number of objects (both dirty and non-dirty) in the cache.

CACHE-CREATE-OBJECT (OBJECT CACHE)

Adds a new object to the cache and returns an object id that can be used to retrieve the object from the cache. Don't use this function twice for the same object.

CACHE-GET-OBJECT (OBJECT-ID CACHE)

Retrieves the object with the given id from the cache and returns that object.

CACHE-RECOVER (CACHE)

Undoes partially committed transactions to ensure that the cache is in a consistent state.

CACHE-ROLLBACK (CACHE)

Undoes all cache changes that were made since the last cache-commit.

CLOSE-CACHE (CACHE &KEY COMMIT (COMMIT T))

Closes the cache. If COMMIT is true (which is the default), the objects in the cache will be written to disk before closing the cache.

CLOSE-TRANSACTION (CACHE TRANSACTION)

Removes a transaction from the set of open transactions.

INDEX-DELETE (INDEX KEY VALUE &KEY IF-DOES-NOT-EXIST (IF-DOES-NOT-EXIST IGNORE))

Remove a key/value pair from an index. IF-DOES-NOT-EXIST can be either :IGNORE (default) or :ERROR.

INDEX-INSERT (INDEX KEY VALUE &KEY IF-EXISTS (IF-EXISTS OVERWRITE))

Insert a key/value pair into an index. IF-EXISTS can be either :OVERWRITE (default) or :ERROR.

MAP-BTREE (BTREE FUNCTION &KEY MIN MAX INCLUDE-MIN INCLUDE-MAX ORDER (ORDER ASCENDING))

Calls FUNCTION for all key/value associations in the btree where key is in the specified interval (this means that FUNCTION can be called with the same key more than once for btrees with non-unique keys). FUNCTION must be a binary function; the first argument is the btree key, the second argument is an associated value. MIN, MAX, INCLUDE-MIN and INCLUDE-MAX specify the interval. The interval is left-open if MIN is nil, right-open if MAX is nil. The interval is inclusive on the left if INCLUDE-MIN is true (and exclusive on the left otherwise). The interval is inclusive on the right if INCLUDE-MAX is true (and exclusive on the right otherwise). ORDER is either :ASCENDING (default) or :DESCENDING.

MAP-BTREE-KEYS (BTREE FUNCTION &KEY MIN MAX INCLUDE-MIN INCLUDE-MAX ORDER (ORDER ASCENDING))

Calls FUNCTION for all keys in the btree where key is in the specified interval. FUNCTION must be a binary function; the first argument is the btree key, the second argument is the btree value (or persistent list of values, for btrees with non-unique keys). FUNCTION will be called exactly once for each key in the btree. MIN, MAX, INCLUDE-MIN and INCLUDE-MAX specify the interval. The interval is left-open if MIN is nil, right-open if MAX is nil. The interval is inclusive on the left if INCLUDE-MIN is true (and exclusive on the left otherwise). The interval is inclusive on the right if INCLUDE-MAX is true (and exclusive on the right otherwise). ORDER is either :ASCENDING (default) or :DESCENDING.

MAP-INDEX (INDEX FUNCTION &KEY EQUAL MIN MAX INCLUDE-MIN INCLUDE-MAX ORDER (EQUAL NIL) (ORDER ASCENDING))

Calls FUNCTION for all key/value pairs in the btree where key is in the specified interval. FUNCTION must be a binary function; the first argument is the index key, the second argument is the index value (or list of values, for indexes with non-unique keys). If EQUAL is specified, the other arguments are ignored; the function will be called once (if there is a key with the same value as EQUAL) or not at all (if there is no such key). MIN, MAX, INCLUDE-MIN and INCLUDE-MAX specify the interval. The interval is left-open if MIN is nil, right-open if MAX is nil. The interval is inclusive on the left if INCLUDE-MIN is true (and exclusive on the left otherwise). The interval is inclusive on the right if INCLUDE-MAX is true (and exclusive on the right otherwise). ORDER is either :ASCENDING (default) or :DESCENDING.

MAP-RUCKSACK-ROOTS (FUNCTION RUCKSACK)

Applies a function to all objects in the root set of a rucksack.

MAP-TRANSACTIONS (CACHE FUNCTION)

Applies a function to each open transaction in a cache.

OPEN-TRANSACTION (CACHE TRANSACTION)

Adds a transaction to the set of open transactions.

P-EQL (X Y)

The persistent equivalent of EQL.

RUCKSACK-ADD-SLOT-INDEX (RUCKSACK CLASS-DESIGNATOR SLOT INDEX-SPEC UNIQUE-P &KEY ERRORP (ERRORP NIL))

Creates a new slot index for the slot designated by CLASS-DESIGNATOR and SLOT. The type of index is specified by INDEX-SPEC. Returns the new index. Signals an error if ERRORP is T and there already is an index for the designated slot.

RUCKSACK-CLASS-INDEX (RUCKSACK CLASS-DESIGNATOR &KEY ERRORP (ERRORP NIL))

Returns the class index for a class designator.

RUCKSACK-COMMIT (RUCKSACK)

Ensures that all in-memory data is saved to disk.

RUCKSACK-DELETE-OBJECT (RUCKSACK OBJECT)

Removes OBJECT from RUCKSACK, i.e. removes object from the rucksack roots (if it is a root) and from all class and slot indexes in which it appears.

RUCKSACK-MAKE-CLASS-INDEX (RUCKSACK CLASS &KEY INDEX-SPEC (INDEX-SPEC '(BTREE KEY< < VALUE= P-EQL)))

Creates a new class index and returns that index. INDEX-SPEC specifies the kind of index that must be created (if not supplied, the rucksack's default class index spec will be used.

RUCKSACK-MAP-CLASS (RUCKSACK CLASS FUNCTION &KEY ID-ONLY INCLUDE-SUBCLASSES (ID-ONLY NIL) (INCLUDE-SUBCLASSES T))

FUNCTION is a unary function that gets called for all instances of the specified class. Unindexed classes (i.e. classes for which the :indexed class option is nil) will be skipped. If ID-ONLY is T (default is NIL), the function will be called with object ids instead of 'real' objects. This can be handy if you want to do more filtering before actually loading objects from disk. INCLUDE-SUBCLASSES defaults to T.

RUCKSACK-MAP-CLASS-INDEXES (RUCKSACK FUNCTION)

FUNCTION must take two arguments: a class name and a class index. It is called for all class indexes in the specified rucksack.

RUCKSACK-MAP-SLOT (RUCKSACK CLASS SLOT FUNCTION &KEY EQUAL MIN MAX INCLUDE-MIN INCLUDE-MAX ORDER INCLUDE-SUBCLASSES (EQUAL NIL EQUAL-SUPPLIED) (ORDER ASCENDING) (INCLUDE-SUBCLASSES T))

FUNCTION is a unary function that gets called for all instances of the specified class that have a slot value matching the EQUAL, MIN, MAX INCLUDE-MIN and INCLUDE-MAX arguments (see the documentation of MAP-INDEX for a description of these arguments). ORDER can be either :ASCENDING (default) or :DESCENDING; currently, the specified order will be respected for instances of one class but not across subclasses. If ID-ONLY is T (default is NIL), the function will be called with object ids instead of 'real' objects. This can be handy if you want to do more filtering before actually loading objects from disk. INCLUDE-SUBCLASSES defaults to T.

RUCKSACK-MAP-SLOT-INDEXES (RUCKSACK FUNCTION &KEY CLASS INCLUDE-SUBCLASSES (CLASS T) (INCLUDE-SUBCLASSES T))

FUNCTION must take three arguments: a class name, a slot name and a slot index. It is called for all slot indexes in the specified rucksack. CLASS defaults to T, meaning all classes. INCLUDE-SUBCLASSES defaults to T.

RUCKSACK-MAYBE-INDEX-CHANGED-SLOT (RUCKSACK CLASS OBJECT SLOT OLD-VALUE NEW-VALUE OLD-BOUNDP NEW-BOUNDP)

This function is called after a slot has changed. OLD-VALUE is the slot's value before the change, NEW-VALUE is the current value. OLD-BOUNDP is true iff the slot was bound before the change, NEW-BOUNDP is true iff the slot is currently bound.

RUCKSACK-MAYBE-INDEX-NEW-OBJECT (RUCKSACK CLASS-DESIGNATOR OBJECT)

Adds the object id of OBJECT to the class index for the class designated by CLASS-DESIGNATOR. If there is no such class index, it does nothing.

RUCKSACK-ROLLBACK (RUCKSACK)

....

RUCKSACK-ROOTS (RUCKSACK)

Returns a list with all objects in the root set of a rucksack. You shouldn't modify this list.

RUCKSACK-SLOT-INDEX (RUCKSACK CLASS-DESIGNATOR SLOT &KEY ERRORP INCLUDE-SUPERCLASSES (ERRORP NIL) (INCLUDE-SUPERCLASSES NIL))

Returns the slot index for the slot specified by CLASS-DESIGNATOR and SLOT.

TRANSACTION-COMMIT-1 (TRANSACTION CACHE RUCKSACK)

Save all modified objects to disk.

TRANSACTION-START-1 (CACHE RUCKSACK &ALLOW-OTHER-KEYS)

Creates and returns a new transaction.

Undocumented

BTREE-ERROR-BTREE (CONDITION)

BTREE-ERROR-KEY (CONDITION)

BTREE-ERROR-VALUE (CONDITION)

BTREE-KEY< (BTREE)

BTREE-KEY<= (BTREE)

BTREE-KEY= (BTREE)

BTREE-KEY> (BTREE)

BTREE-KEY>= (BTREE)

BTREE-VALUE= (BTREE)

CACHE-TOUCH-OBJECT (OBJECT CACHE)

CLOSE-HEAP (HEAP)

P-AREF (ARRAY &REST INDICES)

SETFP-AREF (NEW-VALUE ARRAY &REST INDICES)

P-ARRAY-DIMENSIONS (ARRAY)

P-CAR (CONS)

SETFP-CAR (VALUE CONS)

P-CDR (CONS)

SETFP-CDR (VALUE CONS)

P-CONSP (OBJECT)

P-DELETE-IF (TEST LIST &KEY (FROM-END NIL) (START 0) END COUNT KEY)

P-ENDP (OBJECT)

P-FIND (VALUE VECTOR &KEY (END NIL) (START 0) (TEST #'P-EQL) (KEY #'IDENTITY) &ALLOW-OTHER-KEYS)

P-LENGTH (VECTOR)

P-POSITION (VALUE VECTOR &KEY (END NIL) (START 0) (TEST #'P-EQL) (KEY #'IDENTITY))

P-REPLACE (VECTOR-1 VECTOR-2 &KEY (START1 0) END1 (START2 0) END2)

RUCKSACK-ADD-CLASS-INDEX (RUCKSACK CLASS-DESIGNATOR &KEY ERRORP (ERRORP NIL))

RUCKSACK-REMOVE-CLASS-INDEX (RUCKSACK CLASS-DESIGNATOR &KEY ERRORP (ERRORP NIL))

RUCKSACK-REMOVE-SLOT-INDEX (RUCKSACK CLASS-DESIGNATOR SLOT &KEY ERRORP (ERRORP NIL))

TRANSACTION (CONDITION)

UPDATE-PERSISTENT-INSTANCE-FOR-REDEFINED-CLASS (INSTANCE ADDED-SLOTS DISCARDED-SLOTS PROPERTY-LIST)

Private

ALLOCATE-BLOCK (HEAP &KEY SIZE EXPAND (EXPAND T) &ALLOW-OTHER-KEYS)

Allocates a block of the requested size and returns the heap position of that block. If the free list is full and EXPAND is true, the system will try to expand the free list; otherwise it returns nil. As a second value, ALLOCATE-BLOCK returns the number of octets that were allocated. Note: both the requested size and the returned heap position include the block's header.

BLOCK-SIZE (BLOCK HEAP)

Returns the size of the block starting at the specified position. This includes the size of the block header.

CACHE-DELETE-OBJECT (OBJECT-ID CACHE)

Removes an object-id from the cache and from the object table, so the object-id can be reused for another object later.

DELETE-RUCKSACK-ROOT (OBJECT RUCKSACK)

Delete an object from the root set of a rucksack.

DESERIALIZE-BYTE (SERIALIZER &OPTIONAL EOF-ERROR-P)

Reads an unsigned-byte from a serializer. EOF-ERROR-P defaults to T.

EXPORT-RUCKSACK (RUCKSACK PATHNAME)

Export all objects in a rucksack to a file. The resulting file can be imported by newer versions of Rucksack.

FIND-CONFLICTING-TRANSACTION (OBJECT-ID CACHE TRANSACTION)

Tries to find an open transaction that has modified the object with the given object-id and is older than the given transaction. Returns this conflicting transaction, if there is one. Otherwise it returns nil.

HEAP-START (HEAP)

Returns the position of the first block in the heap.

MAP-SET-BTREE (SET FUNCTION)

Calls a unary function for each value in a btree-set.

NODE-SEARCH-BINDING (BTREE NODE KEY)

Tries to find KEY in NODE or one of its subnodes. Returns three values if the key was found: the binding, the node containing the binding and the position of the binding in that node. Returns nil otherwise.

RUCKSACK-ROOT-P (OBJECT RUCKSACK)

Returns true iff OBJECT is a member of the root set of a rucksack.

RUCKSACK-UPDATE-CLASS-INDEX (RUCKSACK CLASS)

Compares the current class index for CLASS to the class index that's specified in the :INDEX class option of CLASS. An obsolete class index (i.e. a class index that's specified anymore in the class option) is removed, new class indexes are added.

RUCKSACK-UPDATE-SLOT-INDEXES (RUCKSACK CLASS)

Compares the current slot indexes for CLASS to the slot indexes that are specified in the slot options for the direct slots of CLASS. Obsolete slot indexes (i.e. slot indexes that are not specified anymore in the slot options or indexes for slots that don't exist anymore) are removed, new slot indexes are added.

SCAN (BUFFER GARBAGE-COLLECTOR)

Scans the object in the serialization buffer, marking or evacuating (depending on garbage collector type) any child objects.

SCAN-BYTE (SERIALIZER &OPTIONAL GC)

Skips an unsigned byte from the serializer.

SERIALIZE (OBJECT SERIALIZER)

Writes a serialized version of an object to the stream in a serializer.

SERIALIZE-BYTE (BYTE SERIALIZER)

Writes an unsigned-byte to a serializer.

SET-BTREE-DELETE (SET VALUE &KEY IF-DOES-NOT-EXIST (IF-DOES-NOT-EXIST NIL))

Removes a value from a set-btree and returns the modified set-btree. If the value is not present in the set, this function signals an error if IF-DOES-NOT-EXIST is :ERROR (if IF-DOES-NOT-EXIST is :IGNORE, it returns nil).

SET-BTREE-EMPTY-P (SET)

Returns true iff a btree-set is empty.

SET-BTREE-INSERT (SET VALUE)

Add a value to a set-btree. This will modify the set-btree.

SET-COUNT (SET)

Returns the number of values in a btree-set.

TRANSACTION-CHANGED-OBJECT (TRANSACTION OBJECT-ID)

If the given transaction has modified the object with the given object id, this function returns the modified object. Otherwise it returns nil.

TRANSACTION-OLDER-P (A B)

Returns true iff transaction A is older than transaction B.

UNDO-OBJECT-COMMIT (CACHE TRANSACTION-ID OBJECT-ID)

If the object version list contains a version with the given transaction-id, unhook that version from the list. Returns T if the object was already comitted, otherwise nil.

Undocumented

ADD-SCHEMA (TABLE SCHEMA)

ADD-TO-QUEUE (OBJECT-ID CACHE)

BLOCK-ALIVE-P (OBJECT-TABLE OBJECT-ID BLOCK)

BLOCK-HEADER (BLOCK HEAP)

SETFBLOCK-HEADER (VALUE BLOCK HEAP)

BLOCK-HEADER-SIZE (HEAP)

SETFBLOCK-SIZE (SIZE BLOCK HEAP)

BNODE-DELETE-KEY (BTREE NODE PARENT-STACK KEY IF-DOES-NOT-EXIST)

BNODE-INSERT (BTREE NODE PARENT-STACK KEY VALUE IF-EXISTS)

BNODE-NR-KEYS (NODE)

BTREE-BALANCED-P (BTREE)

BTREE-DEPTHS (BTREE)

BUFFER-COUNT (BUFFER)

CACHE-FULL-P (CACHE)

CACHE-ROOM (CACHE)

CARVE-UP-BLOCK-FOR-FREE-LIST (SIZE-CLASS BLOCK SIZE HEAP)

CLASS-INDEX (CLASS)

CLASS-INDEX-TABLE (RUCKSACK)

COLLECT-GARBAGE (HEAP)

COLLECT-SOME-GARBAGE (HEAP AMOUNT)

COMPUTE-PERSISTENT-SLOT-NAMES (CLASS OBJECT)

CREATE-SCHEMA (TABLE CLASS VERSION &OPTIONAL (PERSISTENT-SLOTS))

DEALLOCATE-BLOCK (BLOCK HEAP)

DESERIALIZE-CONTENTS (MARKER STREAM)

EXPAND-FREE-LIST (SIZE-CLASS HEAP)

EXPAND-HEAP (HEAP BLOCK-SIZE)

FIND-BLOCK (MIN-SIZE HEAP)

FIND-OR-CREATE-SCHEMA-FOR-OBJECT (TABLE OBJECT)

FIND-SCHEMA-FOR-CLASS (TABLE CLASS)

FIND-SCHEMA-FOR-ID (TABLE ID &KEY (ERRORP T))

FINISH-ALL-OUTPUT (RUCKSACK)

FINISH-GARBAGE-COLLECTION (HEAP)

FINISH-HEAP-OUTPUT (HEAP)

FREE-LIST-EMPTY-P (SIZE-CLASS HEAP)

FREE-LIST-INFO (SIZE-CLASS HEAP)

FREE-LIST-START (HEAP &OPTIONAL (SIZE-CLASS))

SETFFREE-LIST-START (POINTER HEAP &OPTIONAL (SIZE-CLASS))

FREE-SPACE (HEAP)

FRESH-SCHEMA-ID (TABLE)

GC-WORK-FOR-SIZE (HEAP SIZE)

HANDLE-WRITTEN-OBJECT (OBJECT-ID BLOCK HEAP)

HEAP-INFO (HEAP)

HEAP-SIZE (HEAP)

INDEX-DATA-DELETE (INDEX KEY VALUE &KEY (IF-DOES-NOT-EXIST IGNORE))

INDEX-DATA-INSERT (INDEX KEY VALUE &KEY (IF-EXISTS OVERWRITE))

INDEX-SIMILAR-P (INDEX-1 INDEX-2)

INITIALIZE-BLOCK (BLOCK BLOCK-SIZE HEAP)

LOAD-BLOCK (HEAP BLOCK &KEY (BUFFER (SERIALIZATION-BUFFER HEAP)) (SKIP-HEADER NIL))

LOAD-BUFFER (BUFFER STREAM NR-OCTETS &KEY FILE-POSITION EOF-ERROR-P)

LOAD-HEAP-END (HEAP)

LOAD-OBJECT (OBJECT-ID TRANSACTION CACHE)

LOAD-SLOTS (OBJECT SERIALIZER)

MAKE-ROOM-IN-CACHE (CACHE)

MAP-BTREE-KEYS-FOR-NODE (BTREE NODE FUNCTION MIN MAX INCLUDE-MIN INCLUDE-MAX ORDER)

MAP-INDEX-DATA (INDEX FUNCTION &REST ARGS &KEY MIN MAX INCLUDE-MIN INCLUDE-MAX (EQUAL NIL EQUAL-SUPPLIED) (ORDER ASCENDING))

MARK-ROOT (HEAP OBJECT-ID)

MARK-SOME-OBJECTS-IN-TABLE (HEAP AMOUNT)

MARK-SOME-ROOTS (HEAP AMOUNT)

MAX-WORK (HEAP)

MAYBE-DEREFERENCE-PROXY (PROXY)

MAYBE-UPDATE-SCHEMAS (TABLE CLASS)

NODE-MAX-DEPTH (NODE)

NODE-MIN-DEPTH (NODE)

NR-HEAP-BYTES (HEAP)

NR-OBJECT-BYTES (HEAP)

NR-PERSISTENT-SLOTS (SCHEMA)

OLD-SCHEMAS-FOR-CLASS (TABLE CLASS)

OLD-TRANSACTION (CONDITION)

P-NREVERSE (OBJECT)

PERSISTENT-DATA-READ (FUNCTION DATA &REST ARGS)

PERSISTENT-DATA-WRITE (FUNCTION DATA VALUE &REST ARGS)

RESET-ALLOCATION-COUNTER (HEAP)

RESET-BUFFER (BUFFER)

RUCKSACK-ROOTS-PATHNAME (RUCKSACK)

SAVE-BUFFER (BUFFER STREAM &KEY FILE-POSITION)

SAVE-DIRTY-OBJECT (OBJECT CACHE TRANSACTION OBJECT-ID &KEY SCHEMA)

SAVE-OBJECT (OBJECT OBJECT-ID CACHE TRANSACTION-ID PREVIOUS-BLOCK &KEY SCHEMA)

SAVE-SCHEMA-TABLE (TABLE)

SAVE-SCHEMA-TABLE-IF-NECESSARY (TABLE)

SAVE-SLOTS (OBJECT SERIALIZER)

SAVED-SLOTS (OBJECT)

SCAN-CONTENTS (MARKER SERIALIZER GARBAGE-COLLECTOR)

SCAN-OBJECT (OBJECT-ID BLOCK GC)

SIZE-CLASS (SIZE HEAP)

SIZE-CLASS-BLOCK-SIZE (SIZE-CLASS HEAP)

SLOT-ERROR-NAME (CONDITION)

SLOT-ERROR-OBJECT (CONDITION)

SLOT-ERROR-OTHER-OBJECT (CONDITION)

SLOT-ERROR-VALUE (CONDITION)

SLOT-INDEX-TABLES (RUCKSACK)

SWEEP-SOME-HEAP-BLOCKS (HEAP AMOUNT)

SWEEP-SOME-OBJECT-BLOCKS (HEAP AMOUNT)

TRANSACTION-NR-DIRTY-OBJECTS (TRANSACTION)

TRANSACTION-ROLLBACK-1 (TRANSACTION CACHE RUCKSACK)

TRANSACTION-TOUCH-OBJECT (TRANSACTION OBJECT OBJECT-ID)

WORK-DONE (HEAP)

WORK-LEFT (HEAP)

SLOT-ACCESSOR

Public

BTREE-KEY-TYPE (OBJECT)

The type of all keys.

BTREE-MAX-NODE-SIZE (OBJECT)

An integer specifying the preferred maximum number of keys per btree node.

BTREE-UNIQUE-KEYS-P (OBJECT)

If false, one key can correspond to more than one value. In that case, the values are assumed to be objects for which the function OBJECT-ID is defined (and returns a unique integer).

BTREE-VALUE-TYPE (OBJECT)

The type of all values.

CACHE-SIZE (CACHE)

The Returns the number of non-dirty objects that the cache may keep in memory.

SETFCACHE-SIZE (NEW-VALUE OBJECT)

Set the Returns the number of non-dirty objects that the cache may keep in memory.

HEAP-END (HEAP)

The Returns the end of the heap.

SETFHEAP-END (VALUE HEAP)

The Modifies the end of the heap.

HEAP-STREAM (HEAP)

The Returns the heap's stream.

SETFHEAP-STREAM (NEW-VALUE OBJECT)

Set the Returns the heap's stream.

OBJECT-ID (OBJECT)

The Returns the object id of a persistent-object or persistent-data.

RUCKSACK (CONDITION)

Back pointer to the rucksack.

RUCKSACK-CACHE (RUCKSACK)

The Returns the cache for a rucksack.

RUCKSACK-DIRECTORY (RUCKSACK)

The Returns a pathname for the directory that contains all files of a rucksack.

Undocumented

BTREE-NODE-CLASS (OBJECT)

HEAP (OBJECT)

TRANSACTION-ID (OBJECT)

Private

ADDED-SLOT-NAMES (OBJECT)

A list with the names of all persistent slots that were added by the most recent version (compared to this version).

SETFADDED-SLOT-NAMES (NEW-VALUE OBJECT)

A list with the names of all persistent slots that were added by the most recent version (compared to this version).

BNODE-BINDINGS (OBJECT)

A vector of with alternating keys and values. The keys are sorted by KEY<. No two keys can be the same. For leaf nodes of btrees with non-unique-keys, the value part is actually a list of values. For intermediate nodes, the value is a child node. All keys in the child node will be KEY<= the child node's key in the parent node.

SETFBNODE-BINDINGS (NEW-VALUE OBJECT)

A vector of with alternating keys and values. The keys are sorted by KEY<. No two keys can be the same. For leaf nodes of btrees with non-unique-keys, the value part is actually a list of values. For intermediate nodes, the value is a child node. All keys in the child node will be KEY<= the child node's key in the parent node.

BNODE-NR-BINDINGS (OBJECT)

The number of key/value bindings in the index vector.

SETFBNODE-NR-BINDINGS (NEW-VALUE OBJECT)

The number of key/value bindings in the index vector.

BTREE-KEY-KEY (OBJECT)

A unary function that is applied to a btree key before comparing it to another key with a key comparison predicate like BTREE-KEY<.

BTREE-VALUE-KEY (OBJECT)

A unary function that is applied to a btree value before comparing it to another value with the BTREE-VALUE= predicate.

CACHE-SHRINK-RATIO (OBJECT)

A number between 0 and 1. When the cache is full, i.e. when there are at least SIZE (non-dirty) objects in the queue, it will be shrunk by removing (1 - SHRINK-RATIO) * SIZE objects.

SETFCACHE-SHRINK-RATIO (NEW-VALUE OBJECT)

A number between 0 and 1. When the cache is full, i.e. when there are at least SIZE (non-dirty) objects in the queue, it will be shrunk by removing (1 - SHRINK-RATIO) * SIZE objects.

CLASS-CHANGED-P (OBJECT)

True iff the class definition was changed but the schemas haven't been updated yet. This flag is necessary because some MOP implementations don't call FINALIZE-INHERITANCE when a class was redefined and a new instance of the redefined class is created.

SETFCLASS-CHANGED-P (NEW-VALUE OBJECT)

True iff the class definition was changed but the schemas haven't been updated yet. This flag is necessary because some MOP implementations don't call FINALIZE-INHERITANCE when a class was redefined and a new instance of the redefined class is created.

DIRTY-OBJECTS (OBJECT)

A hash-table (from id to object) containing all objects of which the slot changes have not been written to disk yet.

DIRTY-P (OBJECT)

When dirty, the schema table will be saved at the next commit.

SETFDIRTY-P (NEW-VALUE OBJECT)

When dirty, the schema table will be saved at the next commit.

DIRTY-QUEUE (OBJECT)

A queue with the ids of all objects that have been created or modified since the last commit. The queue is in least-recently-dirtied-first order. During a commit, the objects are written to disk in the same order (this is necessary to guarantee that the garbage collector never sees an id of an object that doesn't exist on disk yet.

DISCARDED-SLOT-NAMES (OBJECT)

A list with the names of all persistent slots that were discarded by the most recent version (compared to this version).

SETFDISCARDED-SLOT-NAMES (NEW-VALUE OBJECT)

A list with the names of all persistent slots that were discarded by the most recent version (compared to this version).

EXPANSION-SIZE (OBJECT)

The minimum number of bytes that will be used to expand a free-list.

GC-DOING-WORK (OBJECT)

A flag to prevent recursive calls to COLLECT-SOME-GARBAGE.

SETFGC-DOING-WORK (NEW-VALUE OBJECT)

A flag to prevent recursive calls to COLLECT-SOME-GARBAGE.

GROW-SIZE (OBJECT)

Specifies a minimum amount to grow the heap when it needs to grow. If 'grow size' is an integer, the expected growth rate is additive and the integer is the number of octets to add; if it is a float, the expected growth rate for the heap is multiplicative and the float is the ratio of the new size to the old size. (The actual size might be rounded up.)

SETFGROW-SIZE (NEW-VALUE OBJECT)

Specifies a minimum amount to grow the heap when it needs to grow. If 'grow size' is an integer, the expected growth rate is additive and the integer is the number of octets to add; if it is a float, the expected growth rate for the heap is multiplicative and the float is the ratio of the new size to the old size. (The actual size might be rounded up.)

HIGHEST-TRANSACTION-ID (OBJECT)

The highest transaction ID in the entire rucksack. This is saved together with the roots.

SETFHIGHEST-TRANSACTION-ID (NEW-VALUE OBJECT)

The highest transaction ID in the entire rucksack. This is saved together with the roots.

INDEX-DATA (OBJECT)

The actual index data structure (e.g. a btree).

MAX-HEAP-END (OBJECT)

The maximum acceptable value for heap-end during the current garbage collection.

SETFMAX-HEAP-END (NEW-VALUE OBJECT)

The maximum acceptable value for heap-end during the current garbage collection.

MAX-HEAP-SIZE (OBJECT)

The maximum size (in octets) for the heap. If nil, the heap is allowed to expand indefinitely.

SETFMAX-HEAP-SIZE (NEW-VALUE OBJECT)

The maximum size (in octets) for the heap. If nil, the heap is allowed to expand indefinitely.

MIN-BLOCK-SIZE (OBJECT)

The size of the smallest blocks. This must be a power of 2.

NR-ALLOCATED-OCTETS (OBJECT)

The number of octets that have been allocated by ALLOCATE-BLOCK since the last time that RESET-ALLOCATION-COUNTER was called.

SETFNR-ALLOCATED-OCTETS (NEW-VALUE OBJECT)

The number of octets that have been allocated by ALLOCATE-BLOCK since the last time that RESET-ALLOCATION-COUNTER was called.

OBJECTS (OBJECT)

A hash-table (from id to object) containing the youngest committed version of all objects that are currently kept in memory but are not dirty. ('The youngest version' means the version belonging to the youngest committed transaction.)

PERSISTENT-SLOT-NAMES (OBJECT)

A list with the names of all persistent effective slots.

SETFPERSISTENT-SLOT-NAMES (NEW-VALUE OBJECT)

A list with the names of all persistent effective slots.

ROOTS (OBJECT)

A list of object-ids of roots that must be kept alive.

SETFROOTS (NEW-VALUE OBJECT)

A list of object-ids of roots that must be kept alive.

SCHEMA-ID (OBJECT)

A unique number that identifies a schema.

SCHEMA-TABLE-BY-ID (OBJECT)

A mapping from a schema id to a schema.

SETFSCHEMA-TABLE-BY-ID (NEW-VALUE OBJECT)

A mapping from a schema id to a schema.

SCHEMA-TABLE-BY-NAME (OBJECT)

A mapping from class names to a list (most recent version first) of schemas.

SCHEMA-VERSION (OBJECT)

The combination of class-name and version number also uniquely identifies a schema.

SERIALIZER-STREAM (OBJECT)

An (unsigned-byte 8) stream.

SLOT-INDEX (OBJECT)

An index spec designator for indexed slots, NIL for non-indexed slots. Default value is NIL.

SLOT-PERSISTENCE (OBJECT)

T for persistent slots, NIL for transient slots. Default value is T.

SLOT-UNIQUE (OBJECT)

Only relevant for indexed slots. Can be either NIL (slot values are not unique), T (slot values are unique, and an error will be signaled for attempts to add a duplicate slot value) or :NO-ERROR (slot values are unique, but no error will be signaled for attempts to add a duplicate slot value). :NO-ERROR should only be used when speed is critical. The default value is NIL.

TRANSACTIONS (OBJECT)

A mapping from transaction ids to transactions. Contains only open transactions, i.e. transactions that haven't been rolled back or committed.

Undocumented

BNODE-LEAF-P (OBJECT)

BTREE-ROOT (OBJECT)

SETFBTREE-ROOT (NEW-VALUE OBJECT)

CELL-BUFFER (OBJECT)

CLASS-PERSISTENT-SLOTS (OBJECT)

SETFCLASS-PERSISTENT-SLOTS (NEW-VALUE OBJECT)

CONTENTS (OBJECT)

SETFCONTENTS (NEW-VALUE OBJECT)

HIGHEST-SCHEMA-ID (OBJECT)

SETFHIGHEST-SCHEMA-ID (NEW-VALUE OBJECT)

INDEX-SPEC (OBJECT)

INDEX-UNIQUE-KEYS-P (OBJECT)

LAST-TIMESTAMP (OBJECT)

SETFLAST-TIMESTAMP (NEW-VALUE OBJECT)

NR-FREE-LISTS (OBJECT)

NR-HEAP-BYTES-SCANNED (OBJECT)

SETFNR-HEAP-BYTES-SCANNED (NEW-VALUE OBJECT)

NR-HEAP-BYTES-SWEEPED (OBJECT)

SETFNR-HEAP-BYTES-SWEEPED (NEW-VALUE OBJECT)

NR-OBJECT-BYTES-MARKED (OBJECT)

SETFNR-OBJECT-BYTES-MARKED (NEW-VALUE OBJECT)

NR-OBJECT-BYTES-SWEEPED (OBJECT)

SETFNR-OBJECT-BYTES-SWEEPED (NEW-VALUE OBJECT)

OBJECT-TABLE (OBJECT)

ROOTS-CHANGED-P (OBJECT)

SETFROOTS-CHANGED-P (NEW-VALUE OBJECT)

RUCKSACK-TRANSACTION-LOCK (OBJECT)

SCAN-POINTER (OBJECT)

SETFSCAN-POINTER (NEW-VALUE OBJECT)

SCHEMA-CLASS-NAME (OBJECT)

SCHEMA-OBSOLETE-P (OBJECT)

SETFSCHEMA-OBSOLETE-P (NEW-VALUE OBJECT)

SCHEMA-TABLE (OBJECT)

SCHEMA-TABLE-PATHNAME (OBJECT)

SETFSCHEMA-TABLE-PATHNAME (NEW-VALUE OBJECT)

SERIALIZATION-BUFFER (OBJECT)

STATE (OBJECT)

SETFSTATE (NEW-VALUE OBJECT)

TRANSACTION-ID-HELPER (OBJECT)

SETFTRANSACTION-ID-HELPER (NEW-VALUE OBJECT)

VARIABLE

Public

*RUCKSACK*

The current rucksack (NIL if there is no open rucksack).

*TRANSACTION*

The currently active transaction.

Private

*COLLECT-GARBAGE-ON-COMMIT*

A flag to indicate whether or not transaction-commit collects garbage

*DEFAULT-BUFFER-SIZE*

The number of octets that are allocated initially for a buffer.

*INITIAL-HEAP-SIZE*

The default initial heap size is 10 MB.

Undocumented

*CACHE*

*DONT-DEREFERENCE-PROXIES*

*INDEX-SPECS*

*INITIALIZING-INSTANCE*

*RUCKSACK-OPENING-LOCK*

CLASS

Public

FREE-LIST-HEAP

This heap uses a 'segregated free list' system: the first list contains 16-octet blocks (including the header), the second list contains 32-octet blocks, the third has 64-octet blocks, etc. When there are N free lists, the last is for blocks of 16*2^(N-1) octets. Each block starts with an 8-octet header. If a block is in use, the header contains the block's size. If a block is still free, the header contains a pointer to the next block on the same free list.

PERSISTENT-DATA

PERSISTENT-DATA classes do not have PERSISTENT-CLASS as metaclass because we don't want to specialize SLOT-VALUE-USING-CLASS & friends for persistent-data instances. Their contents are accessed by special functions like P-CAR instead.

PERSISTENT-OBJECT

Classes of metaclass PERSISTENT-CLASS automatically inherit from this class.

SIMPLE-FREE-LIST-HEAP

All blocks in a simple free list heap have the same size.

Undocumented

BTREE

CACHE (OBJECT)

HEAP (OBJECT)

MARK-AND-SWEEP-HEAP

PERSISTENT-ARRAY

PERSISTENT-CLASS

PERSISTENT-CONS

RUCKSACK (CONDITION)

STANDARD-CACHE

STANDARD-RUCKSACK

STANDARD-TRANSACTION

TRANSACTION (CONDITION)

Private

LAZY-CACHE

A lazy cache doesn't bother with fancy mechanisms for deciding which objects to remove from the cache. It just fills the cache until maximum capacity (i.e. CACHE-SIZE) and then clears the entire cache at once. Advantages of this could be that it uses less time and less memory to do its work. Disadvantage is that it's very stupid about the objects it should try to keep in memory.

OBJECT-TABLE (OBJECT)

A file mapping object identifiers to their file-positions in the 'real' heap.

PERSISTENT-OBJECT-SET

A persistent set of persistent-objects, implemented as a btree.

PROXY

Proxies are some kind of in-memory forwarding pointer to data in the cache. They are never saved on disk.

SERIAL-TRANSACTION-RUCKSACK

A serial transaction rucksack allows only one active transaction at a time.

SET-BNODE

A special kind of btree node, used to implement set btrees.

SET-BTREE

A persistent set of objects, implemented as a btree.

Undocumented

APPENDING-HEAP

BINDING

BNODE

BUFFER

GARBAGE-COLLECTOR

INDEX

PERSISTENT-DIRECT-SLOT-DEFINITION

PERSISTENT-EFFECTIVE-SLOT-DEFINITION

PERSISTENT-SLOT-MIXIN

SCHEMA

SCHEMA-TABLE (OBJECT)

SERIALIZATION-BUFFER (OBJECT)

SERIALIZER

CONDITION

Public

Undocumented

BTREE-ERROR

BTREE-INSERTION-ERROR

BTREE-KEY-ALREADY-PRESENT-ERROR

BTREE-SEARCH-ERROR

BTREE-TYPE-ERROR

DUPLICATE-SLOT-VALUE

INTERNAL-RUCKSACK-ERROR (FORMAT-STRING &REST FORMAT-ARGS)

RUCKSACK-ERROR (CLASS &REST ARGS)

SIMPLE-RUCKSACK-ERROR (FORMAT-STRING &REST FORMAT-ARGS)

SLOT-ERROR

TRANSACTION-CONFLICT

Private

Undocumented

BTREE-DELETION-ERROR

CONSTANT

Private

+IGNORE+

This marker is automatically skipped when read. Handy if you need fixed width fields.

+ILLEGAL-MARKER+

This should never be read as a marker.

+P-OBJECT+

The serialization marker for cached objects.

+POINTER-SIZE+

The number of octets for a heap pointer. A heap pointer is a number that must be able to span the entire heap. It is used for block sizes, pointers to other blocks, object ids and object heap positions.

+RESERVED-OBJECT+

Used for entries in the object table that belong to objects that haven't been committed to disk yet.

Undocumented

+ARRAY+

+BASE-CHAR+

+CHARACTER+

+CHARACTER-16+

+CHARACTER-24+

+CHARACTER-32+

+CHARACTER-8+

+COMPLEX+

+CONS+

+DEAD-OBJECT+

+DOTTED-LIST+

+DOUBLE-FLOAT+

+EXTENDED-CHAR+

+EXTENSION-0+

+FLOAT+

+FREE-BLOCK+

+HASH-TABLE+

+KEYWORD+

+LIVE-OBJECT+

+LONG-FLOAT+

+MINUS-ONE+

+NEGATIVE-BYTE-16+

+NEGATIVE-BYTE-24+

+NEGATIVE-BYTE-32+

+NEGATIVE-BYTE-48+

+NEGATIVE-BYTE-64+

+NEGATIVE-BYTE-8+

+NEGATIVE-INTEGER+

+NIL+

+NR-OBJECT-INFO-OCTETS+

+NR-OBJECT-POSITION-OCTETS+

+OBJECT+

+ONE+

+PACKAGE+

+PATHNAME+

+POSITIVE-BYTE-16+

+POSITIVE-BYTE-24+

+POSITIVE-BYTE-32+

+POSITIVE-BYTE-48+

+POSITIVE-BYTE-64+

+POSITIVE-BYTE-8+

+POSITIVE-INTEGER+

+PROPER-LIST+

+RATIONAL+

+SHARED-OBJECT-DEFINITION+

+SHARED-OBJECT-REFERENCE+

+SHORT-FLOAT+

+SIMPLE-STRING+

+SIMPLE-STRING-16+

+SIMPLE-STRING-24+

+SIMPLE-STRING-32+

+SIMPLE-STRING-8+

+SINGLE-FLOAT+

+STRING+

+STRING-16+

+STRING-24+

+STRING-32+

+STRING-8+

+STRUCT+

+STRUCT-DEFINITION+

+STRUCTURE-OBJECT+

+SYMBOL+

+SYMBOL-REFERENCE+

+T+

+TWO+

+UNBOUND-SLOT+

+UNINTERNED-SYMBOL+

+ZERO+