Class OceanClient
object --+
|
OceanClient
This storage works based on records stored in a hashtable The id must
be hashable Internally, there is a long list of records and an index
table which contains references to where these records are
-
Adding a new record * Write the record to the end of the record table
* Hash the key and write the key-reference pair to the index list
-
Removing a record * Remove the entry in the key-reference list (This
should be a B-Tree)
-
Modifying a record * Add the modified record to the end of the record
table * Update the key-reference pair to the new reference * During
packing, remove all unused items in the data table
-
Transactions * During the transaction, everything is in memory * Only
during the commit, stuff gets written to disk
Hence, each storage must have an index file and a data file During
reads, first the whole index is read. Then the list of references are
sorted before the data is read.
Multi Version Concurrency Control This is done as follows. At the
start of a transaction, a copy of the index is made in thread local
memory. The read time of the index is stored as well. During the
transaction, this thread local version of the index is used. When the
transaction commits, the thread local index is written to the global
index (along with a write timestamp). However, if the write timestamp of
the thread global index is > read timestamp of the thread local index,
then the commit fails with a conflict error.
|
|
__init__(self,
fn,
options)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
|
|
|
|
|
|
|
|
|
|
| get(self,
key,
failobj=None) |
|
|
|
|
| __setitem__(self,
key,
v) |
|
|
|
|
| setdefault(self,
key,
failobj=None) |
|
|
|
|
| process_options(self,
options) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| begin_transaction(self,
c=None) |
|
|
|
|
rollback(self,
c=None)
Rollback the transaction |
|
|
|
|
|
|
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__,
__str__
|
|
Inherited from object:
__class__
|
__init__(self,
fn,
options)
(Constructor)
|
|
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
- Overrides:
object.__init__
- (inherited documentation)
|
__repr__(self)
(Representation operator)
|
|
repr(x)
- Overrides:
object.__repr__
- (inherited documentation)
|