Package bw :: Package poseidon :: Module diskindex :: Class BSDDiskIndex
[frames] | no frames]

Class BSDDiskIndex

object --+    
         |    
 DiskIndex --+
             |
            BSDDiskIndex

The BSDDiskIndex uses bsddb as the underlying disk-index implementation. In version 1 of DiskIndex, it was the standard implementation in use for all storage objects. However, it has some unsolved undesirable performance problems specifically with locking. In version 2, it was replaced for all storages except IndexOcean by OceanIndex and SeaIndex. As of March 2, 2008, it is the No 1 performance bottleneck for database commits.

Instance Methods
 
__init__(self, fn, options)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
close(self)
Commits and closes the bsddb.
 
commit(self)
Commits all dirty entries and syncs the bsddb.
 
iterate(self)
 
__len__(self)
Returns the length of the diskindex.
 
__contains__(self, key)
Returns True if key is in the DiskIndex.
 
has_key(self, key)
Same as __contains__
 
read_disk(self, key)
Read key from disk.

Inherited from DiskIndex: __getitem__, __iter__, __setitem__, clean, get, iteritems, update

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self, fn, options)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • fn - The fully qualified pathname of the storage. e.g. "/home/username/brainwave/db/mmap". No extension is provided.
  • options - A dictionary containing additional options
Overrides: object.__init__
(inherited documentation)

close(self)

 

Commits and closes the bsddb.

Overrides: DiskIndex.close

commit(self)

 

Commits all dirty entries and syncs the bsddb. This method is thread-safe.

Overrides: DiskIndex.commit

__len__(self)
(Length operator)

 

Returns the length of the diskindex.

Overrides: DiskIndex.__len__

__contains__(self, key)
(In operator)

 

Returns True if key is in the DiskIndex. Not implemented.

Overrides: DiskIndex.__contains__
(inherited documentation)

has_key(self, key)

 

Same as __contains__

Overrides: DiskIndex.has_key
(inherited documentation)

read_disk(self, key)

 

Read key from disk. Not implemented

Parameters:
  • key - The key whose value is to be read
Overrides: DiskIndex.read_disk
(inherited documentation)