fabric.worker
Interface Store

All Known Implementing Classes:
InProcessStore, LocalStore, RemoteStore

public interface Store


Method Summary
 void abortTransaction(boolean useAuthentication, TransactionID tid)
          Notifies the store that the transaction is being Aborted.
 void cache(Object._Impl impl)
          Adds the given object to the cache.
 boolean checkForStaleObjects(LongKeyMap<java.lang.Integer> reads)
          Determines whether the given set of objects are stale.
 void commitTransaction(boolean useAuthentication, long transactionID)
          Notifies the Store that the transaction should be committed.
 long createOnum()
          Obtains a new, unused object number from the Store.
 boolean evict(long onum)
          Evicts the object with the given onum from cache.
 NodePrincipal getPrincipal()
          Returns the NodePrincipal associated with this store.
 fabric.util.Map getRoot()
          Returns the root map of the Store
 boolean isLocalStore()
          Determines whether this is the local store.
 java.lang.String name()
          Returns this store's host name.
 boolean notifyEvict(long onum)
          Notifies this Store object that an _Impl has been evicted, so that it can perform the necessary cache maintenance.
 boolean prepareTransaction(boolean useAuthentication, long tid, long commitTime, java.util.Collection<Object._Impl> toCreate, LongKeyMap<java.lang.Integer> reads, java.util.Collection<Object._Impl> writes)
          Notifies the store that the transaction is entering the Prepare phase.
 Object._Impl readObject(long onum)
          Returns the requested _Impl object.
 Object._Impl readObjectFromCache(long onum)
          Returns the requested _Impl object if it exists in the object cache.
 Object._Impl readObjectNoDissem(long onum)
          Returns the requested _Impl object, fetching it directly from the Store if it is not resident.
 

Method Detail

name

java.lang.String name()
Returns this store's host name.


getPrincipal

NodePrincipal getPrincipal()
Returns the NodePrincipal associated with this store.


isLocalStore

boolean isLocalStore()
Determines whether this is the local store.


prepareTransaction

boolean prepareTransaction(boolean useAuthentication,
                           long tid,
                           long commitTime,
                           java.util.Collection<Object._Impl> toCreate,
                           LongKeyMap<java.lang.Integer> reads,
                           java.util.Collection<Object._Impl> writes)
                           throws UnreachableNodeException,
                                  TransactionPrepareFailedException
Notifies the store that the transaction is entering the Prepare phase.

Returns:
whether a subtransaction was created on the store as a result of the prepare.
Throws:
UnreachableNodeException
TransactionPrepareFailedException

readObject

Object._Impl readObject(long onum)
                        throws FetchException
Returns the requested _Impl object. If the object is not resident, it is fetched from the Store via dissemination.

Parameters:
onum - The identifier of the requested object
Returns:
The requested object
Throws:
FetchException

readObjectNoDissem

Object._Impl readObjectNoDissem(long onum)
                                throws FetchException
Returns the requested _Impl object, fetching it directly from the Store if it is not resident.

Parameters:
onum - The identifier of the requested object
Returns:
The requested object
Throws:
FetchException

readObjectFromCache

Object._Impl readObjectFromCache(long onum)
Returns the requested _Impl object if it exists in the object cache.

Parameters:
onum - The identifier of the requested object.
Returns:
The requested object if it exists in the object cache; otherwise, null.

abortTransaction

void abortTransaction(boolean useAuthentication,
                      TransactionID tid)
Notifies the store that the transaction is being Aborted.

Parameters:
useAuthentication -
tid - the ID of the aborting transaction. This is assumed to specify a top-level transaction.

commitTransaction

void commitTransaction(boolean useAuthentication,
                       long transactionID)
                       throws UnreachableNodeException,
                              TransactionCommitFailedException
Notifies the Store that the transaction should be committed.

Parameters:
transactionID - the ID of the transaction to commit
Throws:
UnreachableNodeException
TransactionCommitFailedException

checkForStaleObjects

boolean checkForStaleObjects(LongKeyMap<java.lang.Integer> reads)
Determines whether the given set of objects are stale.

Returns:
true iff stale objects were found.

createOnum

long createOnum()
                throws UnreachableNodeException
Obtains a new, unused object number from the Store.

Throws:
UnreachableNodeException

getRoot

fabric.util.Map getRoot()
Returns the root map of the Store


notifyEvict

boolean notifyEvict(long onum)
Notifies this Store object that an _Impl has been evicted, so that it can perform the necessary cache maintenance.

Parameters:
onum - Onum of the object that was evicted.
Returns:
true iff the onum was found in cache.

evict

boolean evict(long onum)
Evicts the object with the given onum from cache.

Returns:
true iff the onum was found in cache.

cache

void cache(Object._Impl impl)
Adds the given object to the cache.