Function
ZODB.FileStorage.FileStorage.read_index

Signature

read_index(file, name, index, vindex, tindex, stop='\xff\xff\xff\xff\xff\xff\xff\xff', ltid='\x00\x00\x00\x00\x00\x00\x00\x00', start=4L, maxoid='\x00\x00\x00\x00\x00\x00\x00\x00', recover=0, read_only=0)

Documentation String

Scan the file storage and update the index.

Returns file position, max oid, and last transaction id. It also stores index information in the three dictionary arguments.

Arguments: file -- a file object (the Data.fs) name -- the name of the file (presumably file.name) index -- fsIndex, oid -> data record file offset vindex -- dictionary, oid -> data record offset for version data tindex -- dictionary, oid -> data record offset tindex is cleared before return

There are several default arguments that affect the scan or the return values. TODO: document them.

start
the file position at which to start scanning for oids added beyond the ones the passed-in indices know about. The .index file caches the highest ._pos FileStorage knew about when the the .index file was last saved, and that's the intended value to pass in for start; accept the default (and pass empty indices) to recreate the index from scratch maxoid -- ignored (it meant something prior to ZODB 3.2.6; the argument still exists just so the signature of read_index() stayed the same)

The file position returned is the position just after the last valid transaction record. The oid returned is the maximum object id in `index`, or z64 if the index is empty. The transaction id is the tid of the last transaction, or ltid if the index is empty.