|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfabric.store.db.ObjectDB
fabric.store.db.BdbDB
public class BdbDB
An ObjectDB backed by a Berkeley Database.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class fabric.store.db.ObjectDB |
---|
ObjectDB.PendingTransaction |
Field Summary |
---|
Fields inherited from class fabric.store.db.ObjectDB |
---|
name, pendingByTid, rwLocks |
Constructor Summary | |
---|---|
BdbDB(java.lang.String name)
Creates a new BdbStore for the store specified. |
Method Summary | |
---|---|
void |
close()
Clean up and close database. |
void |
commit(long tid,
RemoteWorker workerNode,
NodePrincipal workerPrincipal,
SubscriptionManager sm)
Cause the objects prepared in transaction [tid] to be committed. |
boolean |
exists(long onum)
Checks whether an object with the corresponding onum exists, in either prepared or committed form. |
void |
finishPrepare(long tid,
NodePrincipal worker)
Notifies the database that the given transaction is finished preparing. |
int |
getVersion(long onum)
Returns the version number on the object stored at a particular onum. |
boolean |
isInitialized()
Determines whether the object database has been initialized. |
long[] |
newOnums(int num)
Return a set of onums that aren't currently occupied. |
SerializedObject |
read(long onum)
Return the object stored at a particular onum. |
void |
rollback(long tid,
NodePrincipal worker)
Cause the objects prepared in transaction [tid] to be discarded. |
void |
setInitialized()
Sets a flag to indicate that the object database has been initialized. |
Methods inherited from class fabric.store.db.ObjectDB |
---|
abortPrepare, beginTransaction, cacheGroupContainer, ensureInit, getCachedGroupContainer, getName, isPrepared, isWritten, notifyCommittedUpdate, registerRead, registerUpdate, unpin |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BdbDB(java.lang.String name)
name
- name of store to create store for.Method Detail |
---|
public void finishPrepare(long tid, NodePrincipal worker)
ObjectDB
Notifies the database that the given transaction is finished preparing. The transaction is not considered to be prepared until this is called. After calling this method, there should not be any further calls to registerRead() or registerUpdate() for the given transaction. This method MUST be called before calling commit().
Upon receiving this call, the object database should save the prepared transaction to stable storage so that it can be recovered in case of failure.
finishPrepare
in class ObjectDB
public void commit(long tid, RemoteWorker workerNode, NodePrincipal workerPrincipal, SubscriptionManager sm)
ObjectDB
commit
in class ObjectDB
tid
- the transaction idworkerNode
- the remote worker that is performing the commitworkerPrincipal
- the principal requesting the commitpublic void rollback(long tid, NodePrincipal worker)
ObjectDB
rollback
in class ObjectDB
tid
- the transaction idworker
- the principal requesting the rollbackpublic SerializedObject read(long onum)
ObjectDB
read
in class ObjectDB
onum
- the identifier
public int getVersion(long onum) throws AccessException
ObjectDB
getVersion
in class ObjectDB
AccessException
- if no object exists at the given onum.public boolean exists(long onum)
ObjectDB
exists
in class ObjectDB
onum
- the onum of to check
public long[] newOnums(int num)
ObjectDB
Return a set of onums that aren't currently occupied. The ObjectDB may return the same onum more than once from this method, althogh doing so would encourage collisions. There is no assumption of unpredictability or randomness about the returned ids.
The returned onums should be packed in the lower 48 bits. We assume that the object database is never full, and can always provide new onums
newOnums
in class ObjectDB
num
- the number of onums to return
public void close()
close
in class ObjectDB
public boolean isInitialized()
ObjectDB
isInitialized
in class ObjectDB
public void setInitialized()
ObjectDB
setInitialized
in class ObjectDB
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |