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, send
protected RemoteStore(java.lang.String name)
protected RemoteStore(java.lang.String name, java.security.PublicKey key)
public long createOnum() throws UnreachableNodeException
Store
createOnum
in interface Store
UnreachableNodeException
public 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 Store
TransactionPrepareFailedException
UnreachableNodeException
public final ObjectCache.Entry readObject(long onum) throws AccessException
Store
readObject
in interface Store
onum
- The identifier of the requested objectAccessException
public final ObjectCache.Entry readObjectNoDissem(long onum) throws AccessException
Store
readObjectNoDissem
in interface Store
onum
- The identifier of the requested objectAccessException
public ObjectCache.Entry readFromCache(long onum)
Store
readFromCache
in interface Store
onum
- 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.AccessException
public ObjectGlob readEncryptedObjectFromStore(long onum) throws AccessException
onum
- The object number to fetch.AccessException
public java.lang.Object readResolve()
java.io.ObjectStreamException
protected void reserve(int num) throws AccessException, UnreachableNodeException
num
- The number of objects to allocateAccessException
UnreachableNodeException
public void abortTransaction(TransactionID tid) throws AccessException
Store
abortTransaction
in interface Store
tid
- the ID of the aborting transaction. This is assumed to specify a
top-level transaction.AccessException
public void commitTransaction(long transactionID) throws UnreachableNodeException, TransactionCommitFailedException
Store
commitTransaction
in interface Store
transactionID
- the ID of the transaction to commitUnreachableNodeException
TransactionCommitFailedException
public boolean checkForStaleObjects(LongKeyMap<java.lang.Integer> reads)
Store
checkForStaleObjects
in interface Store
protected java.util.List<SerializedObject> getStaleObjects(LongKeyMap<java.lang.Integer> reads)
public java.lang.String toString()
toString
in class java.lang.Object
public Map getRoot()
Store
public NodePrincipal getPrincipal()
Store
getPrincipal
in interface Store
getPrincipal
in class RemoteNode<RemoteStore>
public final boolean isLocalStore()
Store
isLocalStore
in interface Store
public int hashCode()
hashCode
in class java.lang.Object
public void evict(long onum)
Store
public void updateCache(SerializedObject update)
public void cache(Object._Impl impl)
Store
public ObjectCache.Entry cache(SerializedObject obj)
Store
public java.security.PublicKey getPublicKey()
public void clearCache()
Worker.clearCache()
public java.security.cert.X509Certificate[] makeWorkerPrincipal(Worker worker, java.security.PublicKey workerKey)