Sirikata
Public Types | Public Member Functions | Public Attributes
Sirikata::OH::SQLiteStorage::StorageAction Struct Reference
Collaboration diagram for Sirikata::OH::SQLiteStorage::StorageAction:

List of all members.

Public Types

enum  Type {
  Read, ReadRange, Compare, Write,
  Erase, EraseRange, Error
}

Public Member Functions

 StorageAction ()
 Implementation Notes.
 StorageAction (const StorageAction &rhs)
 ~StorageAction ()
StorageActionoperator= (const StorageAction &rhs)
Result execute (SQLiteDBPtr db, const Bucket &bucket, ReadSet *rs)
Result executeWithRetry (SQLiteDBPtr db, const Bucket &bucket, ReadSet *rs, int32 retries, const Duration &retry_wait)

Public Attributes

Type type
Key key
Key keyEnd
String * value

Member Enumeration Documentation

Enumerator:
Read 
ReadRange 
Compare 
Write 
Erase 
EraseRange 
Error 

Constructor & Destructor Documentation

Sirikata::OH::SQLiteStorage::StorageAction::StorageAction ( )

Implementation Notes.

--------------------

This implementation is fairly straightforward since SQLite takes care of almost everything for us. A single table 'persistence' holds all data in rows of (object, key, value). All operations except leases are trivially handled through normal SQLite transactions.

Leases require a little more work since they span transactions. We use a special key to keep track of the lessee and expiration. When transactions are initiated we make sure we have the lease, and also setup renewals. Checking at the beginning of the transaction is sufficient because as soon as we read the data, we have a reader lock and the transaction won't complete if someone else tried to write to it.

Sirikata::OH::SQLiteStorage::StorageAction::StorageAction ( const StorageAction rhs)
Sirikata::OH::SQLiteStorage::StorageAction::~StorageAction ( )

Member Function Documentation

Storage::Result Sirikata::OH::SQLiteStorage::StorageAction::execute ( SQLiteDBPtr  db,
const Bucket bucket,
ReadSet rs 
)
Storage::Result Sirikata::OH::SQLiteStorage::StorageAction::executeWithRetry ( SQLiteDBPtr  db,
const Bucket bucket,
ReadSet rs,
int32  retries,
const Duration retry_wait 
)
SQLiteStorage::StorageAction & Sirikata::OH::SQLiteStorage::StorageAction::operator= ( const StorageAction rhs)

References key, keyEnd, type, and value.


Member Data Documentation


The documentation for this struct was generated from the following files: