public class RemoteStore extends RemoteNode<RemoteStore> implements Store, java.io.Serializable
Worker.getStore() interface. For each remote store, there should
be at most one RemoteStore object representing that store.| Modifier and Type | Class and Description |
|---|---|
protected static class |
RemoteStore.SerializationProxy |
name| Modifier | Constructor and Description |
|---|---|
protected |
RemoteStore(java.lang.String name)
Creates a store representing the store at the given host name.
|
protected |
RemoteStore(java.lang.String name,
java.security.PublicKey key)
Creates a store representing the store at the given host name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortTransaction(TransactionID tid)
Notifies the store that the transaction is being Aborted.
|
void |
cache(Object._Impl impl)
Adds the given object to the cache.
|
ObjectCache.Entry |
cache(SerializedObject obj)
Adds the given object to the cache.
|
boolean |
checkForStaleObjects(LongKeyMap<java.lang.Integer> reads)
Determines whether the given set of objects are stale.
|
void |
clearCache()
Clears the worker's cache for this store.
|
void |
commitTransaction(long transactionID)
Notifies the Store that the transaction should be committed.
|
long |
createOnum()
Obtains a new, unused object number from the Store.
|
void |
evict(long onum)
Evicts the object with the given onum from cache.
|
NodePrincipal |
getPrincipal()
Returns the NodePrincipal associated with this store.
|
java.security.PublicKey |
getPublicKey() |
Map |
getRoot()
Returns the root map of the Store
|
protected java.util.List<SerializedObject> |
getStaleObjects(LongKeyMap<java.lang.Integer> reads)
Helper for checkForStaleObjects.
|
int |
hashCode() |
boolean |
isLocalStore()
Determines whether this is the local store.
|
java.security.cert.X509Certificate[] |
makeWorkerPrincipal(Worker worker,
java.security.PublicKey workerKey)
Returns a certificate chain for a new principal object for the given worker
key.
|
void |
prepareTransaction(long tid,
boolean singleStore,
boolean readOnly,
java.util.Collection<Object._Impl> toCreate,
LongKeyMap<java.lang.Integer> reads,
java.util.Collection<Object._Impl> writes)
Sends a PREPARE message to the store.
|
ObjectGlob |
readEncryptedObjectFromStore(long onum)
Called by dissemination to fetch an encrypted object from the store.
|
ObjectCache.Entry |
readFromCache(long onum)
Returns the cache entry for the given onum.
|
ObjectCache.Entry |
readObject(long onum)
Returns the cache entry for the given onum.
|
ObjectGroup |
readObjectFromStore(long onum)
Goes to the store to get object.
|
ObjectCache.Entry |
readObjectNoDissem(long onum)
Returns the cache entry for the requested object.
|
java.lang.Object |
readResolve()
Looks up the actual Store object when this store is deserialized.
|
protected void |
reserve(int num)
Ensure that a given number of objects can be created without contacting the
store.
|
java.lang.String |
toString() |
void |
updateCache(SerializedObject update)
Updates the worker's cache of objects that originate from this store.
|
getSocket, name, recycle, sendprotected RemoteStore(java.lang.String name)
protected RemoteStore(java.lang.String name,
java.security.PublicKey key)
public long createOnum()
throws UnreachableNodeException
StorecreateOnum in interface StoreUnreachableNodeExceptionpublic void prepareTransaction(long tid,
boolean singleStore,
boolean readOnly,
java.util.Collection<Object._Impl> toCreate,
LongKeyMap<java.lang.Integer> reads,
java.util.Collection<Object._Impl> writes)
throws TransactionPrepareFailedException,
UnreachableNodeException
prepareTransaction in interface StoreTransactionPrepareFailedExceptionUnreachableNodeExceptionpublic final ObjectCache.Entry readObject(long onum) throws AccessException
StorereadObject in interface Storeonum - The identifier of the requested objectAccessExceptionpublic final ObjectCache.Entry readObjectNoDissem(long onum) throws AccessException
StorereadObjectNoDissem in interface Storeonum - The identifier of the requested objectAccessExceptionpublic ObjectCache.Entry readFromCache(long onum)
StorereadFromCache in interface Storeonum - The identifier of the requested object.public ObjectGroup readObjectFromStore(long onum) throws AccessException
onum - The object number to fetchFetchException - if there was an error while fetching the object from the store.AccessExceptionpublic ObjectGlob readEncryptedObjectFromStore(long onum) throws AccessException
onum - The object number to fetch.AccessExceptionpublic java.lang.Object readResolve()
java.io.ObjectStreamExceptionprotected void reserve(int num)
throws AccessException,
UnreachableNodeException
num - The number of objects to allocateAccessExceptionUnreachableNodeExceptionpublic void abortTransaction(TransactionID tid) throws AccessException
StoreabortTransaction in interface Storetid - the ID of the aborting transaction. This is assumed to specify a
top-level transaction.AccessExceptionpublic void commitTransaction(long transactionID)
throws UnreachableNodeException,
TransactionCommitFailedException
StorecommitTransaction in interface StoretransactionID - the ID of the transaction to commitUnreachableNodeExceptionTransactionCommitFailedExceptionpublic boolean checkForStaleObjects(LongKeyMap<java.lang.Integer> reads)
StorecheckForStaleObjects in interface Storeprotected java.util.List<SerializedObject> getStaleObjects(LongKeyMap<java.lang.Integer> reads)
public java.lang.String toString()
toString in class java.lang.Objectpublic Map getRoot()
Storepublic NodePrincipal getPrincipal()
StoregetPrincipal in interface StoregetPrincipal in class RemoteNode<RemoteStore>public final boolean isLocalStore()
StoreisLocalStore in interface Storepublic int hashCode()
hashCode in class java.lang.Objectpublic void evict(long onum)
Storepublic void updateCache(SerializedObject update)
public void cache(Object._Impl impl)
Storepublic ObjectCache.Entry cache(SerializedObject obj)
Storepublic java.security.PublicKey getPublicKey()
public void clearCache()
Worker.clearCache()public java.security.cert.X509Certificate[] makeWorkerPrincipal(Worker worker, java.security.PublicKey workerKey)