Package bw :: Package poseidon :: Module sea :: Class Sea
[frames] | no frames]

Class Sea

 object --+    
          |    
ocean.Ocean --+
              |
             Sea

This storage works exactly like the Ocean storage but the format of data storage is different. It assumes that each data value is a list/set of fixed length records (true for ls, lv, lo but not memes or links) With this assumption, it does not need pickling and is capable of writing partial records (to speed up commits). During a partial write, in case there is no space, it uses binomial expansion to allocate more space at the end of the file

This scheme is similar to MySQL except that we are storing 'multiple tables' in one file (since each data value is a 'table') Hence, binomial expansion is required for automatic tablespace management.

Multi Version Concurrency Control This is easily done in Ocean. However, there are some complications for Sea. The thread local index must also track the (old) length of each table so that it knows how much data to read. In this way, the reference AND the num_rows of each table is read from the index Hence, the header parsing of the tablespace is only for validity checking (i.e the num_rows is stored redundantly in the tablespace header as well as the index)

Instance Methods
 
__init__(self, fn, options)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
pack(self)
 
load_index(self, _index_io)
 
flush_index(self)
 
create_index(self)
 
__repr__(self)
repr(x)
 
read(self, i)
 
put(self, i, data, added)
 
rollback(self, c=None)
 
find_table_count(self, i)
 
commit(self)
 
verify(self)

Inherited from ocean.Ocean: __contains__, __getitem__, __iter__, __len__, __setitem__, begin_transaction, clean_index, clear, close, generate_header, get, has_key, keys, process_options, read_header, setdefault

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

Properties

Inherited from object: __class__

Method Details

__init__(self, fn, options)
(Constructor)

 

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

Overrides: object.__init__
(inherited documentation)

pack(self)

 
Overrides: ocean.Ocean.pack

load_index(self, _index_io)

 
Overrides: ocean.Ocean.load_index

flush_index(self)

 
Overrides: ocean.Ocean.flush_index

create_index(self)

 
Overrides: ocean.Ocean.create_index

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

read(self, i)

 
Overrides: ocean.Ocean.read

put(self, i, data, added)

 
Overrides: ocean.Ocean.put

rollback(self, c=None)

 
Overrides: ocean.Ocean.rollback
(inherited documentation)

commit(self)

 
Overrides: ocean.Ocean.commit