|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfabric.net.RemoteNode
fabric.worker.RemoteStore
public class RemoteStore
Encapsulates a Store. This class maintains two connections to the store (one
with SSL, for worker requests; and one without, for dissemination requests)
and manages all communication. Stores can only be obtained through the
Worker.getStore()
interface. For each remote store, there should
be at most one RemoteStore
object representing that store.
Field Summary |
---|
Fields inherited from class fabric.net.RemoteNode |
---|
name |
Constructor Summary | |
---|---|
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. |
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 |
cleanup()
Cleans up the SerializedObject collector thread. |
void |
clearCache()
Clears the worker's cache for this store. |
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. |
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. |
protected SocketAddress |
lookup()
|
boolean |
notifyEvict(long onum)
Notifies that an object has been evicted from cache. |
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)
Sends a PREPARE message to the store. |
Glob |
readEncryptedObjectFromStore(long onum)
Called by dissemination to fetch an encrypted object from the store. |
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. |
ObjectGroup |
readObjectFromStore(long onum)
Goes to the store to get object. |
Object._Impl |
readObjectNoDissem(long onum)
Returns the requested _Impl object, fetching it directly from the Store if it is not resident. |
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()
|
boolean |
updateCache(SerializedObject update)
Updates the worker's cache of objects that originate from this store. |
Methods inherited from class fabric.net.RemoteNode |
---|
name, openStream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface fabric.worker.Store |
---|
name |
Constructor Detail |
---|
protected RemoteStore(java.lang.String name)
protected RemoteStore(java.lang.String name, java.security.PublicKey key)
Method Detail |
---|
public void cleanup()
cleanup
in class RemoteNode
public long createOnum() throws UnreachableNodeException
Store
createOnum
in interface Store
UnreachableNodeException
public 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 TransactionPrepareFailedException, UnreachableNodeException
prepareTransaction
in interface Store
TransactionPrepareFailedException
UnreachableNodeException
public final Object._Impl readObject(long onum) throws FetchException
readObject
in interface Store
onum
- The identifier of the requested object
FabricException
FetchException
public final Object._Impl readObjectNoDissem(long onum) throws FetchException
Store
readObjectNoDissem
in interface Store
onum
- The identifier of the requested object
FetchException
public Object._Impl readObjectFromCache(long onum)
Store
readObjectFromCache
in interface Store
onum
- The identifier of the requested object.
public ObjectGroup readObjectFromStore(long onum) throws FetchException
onum
- The object number to fetch
FetchException
- if there was an error while fetching the object from the store.public final Glob readEncryptedObjectFromStore(long onum) throws FetchException
onum
- The object number to fetch.
FetchException
public java.lang.Object readResolve()
java.io.ObjectStreamException
protected void reserve(int num) throws UnreachableNodeException
num
- The number of objects to allocate
UnreachableNodeException
public void abortTransaction(boolean useAuthentication, TransactionID tid)
Store
abortTransaction
in interface Store
tid
- the ID of the aborting transaction. This is assumed to specify a
top-level transaction.public void commitTransaction(boolean useAuthentication, long transactionID) throws UnreachableNodeException, TransactionCommitFailedException
Store
commitTransaction
in interface Store
transactionID
- the ID of the transaction to commit
UnreachableNodeException
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
getRoot
in interface Store
public NodePrincipal getPrincipal()
Store
getPrincipal
in interface Store
public final boolean isLocalStore()
Store
isLocalStore
in interface Store
public int hashCode()
hashCode
in class java.lang.Object
public boolean notifyEvict(long onum)
notifyEvict
in interface Store
onum
- Onum of the object that was evicted.
public boolean evict(long onum)
Store
evict
in interface Store
public boolean updateCache(SerializedObject update)
public void cache(Object._Impl impl)
Store
cache
in interface Store
public java.security.PublicKey getPublicKey()
public void clearCache()
Worker.clearCache()
protected SocketAddress lookup() throws java.io.IOException
lookup
in class RemoteNode
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |