public interface Store
| Modifier and Type | Method and Description |
|---|---|
void |
abort(co.paralleluniverse.galaxy.StoreTransaction txn)
Ends a transaction after a failure.
|
long |
alloc(int count,
co.paralleluniverse.galaxy.StoreTransaction txn)
Allocates one or more new (and empty) items in the store. When allocating a single item, it’s better to use
put(), but some data structures might require allocating an array of items. |
co.paralleluniverse.galaxy.StoreTransaction |
beginTransaction()
Creates a new transaction.
|
void |
commit(co.paralleluniverse.galaxy.StoreTransaction txn)
Ends a transaction, and makes all updates visible by all other nodes in the cluster.
|
void |
del(long id,
co.paralleluniverse.galaxy.StoreTransaction txn)
Deletes an item from the store.
|
byte[] |
get(long id)
Retrieves a given data item.
|
void |
get(long id,
co.paralleluniverse.common.io.Persistable object)
Retrieves a given data item into a
Persistable. |
byte[] |
get(long id,
short nodeHint)
Retrieves a given data item, using a hint as to its
owner in the cluster. |
void |
get(long id,
short nodeHint,
co.paralleluniverse.common.io.Persistable object)
|
byte[] |
getFromOwner(long id,
long ownerOf)
Retrieves a given data item, using a hint as to its
owner in the cluster. |
void |
getFromOwner(long id,
long ownerOf,
co.paralleluniverse.common.io.Persistable object)
Retrieves a given data item, using a hint as to its
owner in the cluster. |
int |
getMaxItemSize()
Returns the maximum size, in bytes, of a data item in the grid.
|
long |
getRoot(String rootName,
co.paralleluniverse.galaxy.StoreTransaction txn)
Gets or possibly creates a root data item.
|
void |
gets(long id,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item into a
Persistable, and pins the shared (cached) instance to this node. |
void |
gets(long id,
short nodeHint,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item into a
Persistable with a hint as to its owner in the cluster, and pins the shared (cached) instance to this node. |
byte[] |
gets(long id,
short nodeHint,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item with a hint as to its
owner in the cluster, and pins the shared (cached) instance to this node. |
byte[] |
gets(long id,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item, and pins the shared (cached) instance to this node.
|
void |
getsFromOwner(long id,
long ownerOf,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item with a hint as to its
owner in the cluster, and pins the shared (cached) instance to this node. |
byte[] |
getsFromOwner(long id,
long ownerOf,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item with a hint as to its
owner in the cluster, and pins the shared (cached) instance to this node. |
co.paralleluniverse.galaxy.ItemState |
getState(long id)
Returns an item’s state in the local store.
|
void |
getx(long id,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item into a
Persistable, makes this node its exclusive owner, and pins it. |
void |
getx(long id,
short nodeHint,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item with a hint as to its
owner in the cluster, makes this node its exclusive owner, and pins it. |
byte[] |
getx(long id,
short nodeHint,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item with a hint as to its
owner in the cluster, makes this node its exclusive owner, and pins it. |
byte[] |
getx(long id,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item, makes this node its exclusive owner, and pins it.
|
void |
getxFromOwner(long id,
long ownerOf,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item with a hint as to its
owner in the cluster, makes this node its exclusive owner, and pins it. |
byte[] |
getxFromOwner(long id,
long ownerOf,
co.paralleluniverse.galaxy.StoreTransaction txn)
Retrieves a given data item with a hint as to its
owner in the cluster, makes this node its exclusive owner, and pins it. |
<T> T |
invoke(long id,
co.paralleluniverse.galaxy.LineFunction<T> function) |
boolean |
isPinned(long id)
Tests whether an item is pinned on this node.
|
boolean |
isRootCreated(long rootId,
co.paralleluniverse.galaxy.StoreTransaction txn)
Tests whether a root item has been newly created.
|
void |
push(long id,
short... toNodes)
Makes the given item available in the given nodes’ cache.
|
void |
pushx(long id,
short toNode)
Makes the given item available in the given node’s cache, and makes that node the owner of the item.
|
long |
put(byte[] data,
co.paralleluniverse.galaxy.StoreTransaction txn)
Puts a new item into the store and returns its (newly allocated) ID.
|
long |
put(ByteBuffer data,
co.paralleluniverse.galaxy.StoreTransaction txn)
Puts a new item into the store and returns its (newly allocated) ID.
|
long |
put(co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
Puts a new item into the store and returns its (newly allocated) ID.
|
void |
release(long id)
Releases a line that’s been pinned to this node by one of the
gets, getx, put operations. |
void |
rollback(co.paralleluniverse.galaxy.StoreTransaction txn)
Reverts
set operations that were performed during the transactions. |
void |
set(long id,
byte[] data,
co.paralleluniverse.galaxy.StoreTransaction txn)
Gains ownership of an item and sets its contents.
|
void |
set(long id,
ByteBuffer data,
co.paralleluniverse.galaxy.StoreTransaction txn)
Gains ownership of an item and sets its contents.
|
void |
set(long id,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
Gains ownership of an item and sets its contents.
|
void |
setListener(long id,
co.paralleluniverse.galaxy.CacheListener listener)
Sets a listener listening for local cache events on the given item.
|
int getMaxItemSize()
Returns the maximum size, in bytes, of a data item in the grid. Attempts to store larger items will result in an exception. This limit is set in the cache spring-bean configuration.
co.paralleluniverse.galaxy.StoreTransaction beginTransaction()
Creates a new transaction.
A transaction can be used by more than one thread.
void commit(co.paralleluniverse.galaxy.StoreTransaction txn)
throws InterruptedException
Ends a transaction, and makes all updates visible by all other nodes in the cluster.
txn - The current transaction, which we wish to complete.InterruptedExceptionvoid abort(co.paralleluniverse.galaxy.StoreTransaction txn)
throws InterruptedException
Ends a transaction after a failure.
This method must be called only after rollback() has been called, or a manual rollback has been done.
txn - The current transaction, which we wish to complete after failure.InterruptedExceptionvoid rollback(co.paralleluniverse.galaxy.StoreTransaction txn)
Reverts set operations that were performed during the transactions.
This method does not complete the transaction. endTransaction() must still be called.
txn - The current transaction.void release(long id)
Releases a line that’s been pinned to this node by one of the gets, getx, put operations.
This method must be called to release a line used in one of the gets, getx, put operations, if they were called with a null transaction.
id - long getRoot(String rootName, co.paralleluniverse.galaxy.StoreTransaction txn) throws co.paralleluniverse.galaxy.TimeoutException
Gets or possibly creates a root data item. The same item ID will be returned when this method is called on any cluster node with the same root name.
You can test if the root has been newly created by this transaction by calling .rootName - The root’s name.txn - The current transaction. May not be null.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.boolean isRootCreated(long rootId,
co.paralleluniverse.galaxy.StoreTransaction txn)
Tests whether a root item has been newly created.
rootId - The root item’s ID.txn - The current transaction.true if the root has been created by the current transaction; false if it existed before current transaction.void setListener(long id,
co.paralleluniverse.galaxy.CacheListener listener)
Sets a listener listening for local cache events on the given item.
id - The item’s ID.listener - The listener.long alloc(int count,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Allocates one or more new (and empty) items in the store.
When allocating a single item, it’s better to useput(), but some data structures might require allocating an array of items.count - The number of items to allocate.txn - The current transaction. May not be null.count - 1 IDs belong to the following elements of the array.co.paralleluniverse.galaxy.TimeoutExceptionco.paralleluniverse.fibers.SuspendExecutionlong put(byte[] data,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Puts a new item into the store and returns its (newly allocated) ID.
data - The item’s contents.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionlong put(ByteBuffer data, co.paralleluniverse.galaxy.StoreTransaction txn) throws co.paralleluniverse.galaxy.TimeoutException, co.paralleluniverse.fibers.SuspendExecution
Puts a new item into the store and returns its (newly allocated) ID.
data - The item’s contents.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionlong put(co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Puts a new item into the store and returns its (newly allocated) ID.
object - The item’s contents.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionbyte[] get(long id)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item.
id - The item’s ID.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid get(long id,
co.paralleluniverse.common.io.Persistable object)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item into a Persistable.
id - The item’s ID.object - The object into which the contents of the item will be written.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionbyte[] get(long id,
short nodeHint)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item, using a hint as to its owner in the cluster.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.nodeHint - The ID of the node the data item is probably owned by.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid get(long id,
short nodeHint,
co.paralleluniverse.common.io.Persistable object)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item into a Persistable, using a hint as to its owner in the cluster.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.nodeHint - The ID of the node the data item is probably owned by.object - The object into which the contents of the item will be written.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionbyte[] getFromOwner(long id,
long ownerOf)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item, using a hint as to its owner in the cluster. Unlike the direct hint given in get(long, short), the hinted node here is the owner of a given item.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.ownerOf - The ID of an item whose owner is probably the owner of the requested item as well.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid getFromOwner(long id,
long ownerOf,
co.paralleluniverse.common.io.Persistable object)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item, using a hint as to its owner in the cluster. Unlike the direct hint given in get(long, short, Persistable), the hinted node here is the owner of a given item.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.ownerOf - The ID of an item whose owner is probably the owner of the requested item as well.object - The object into which the contents of the item will be written.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionbyte[] gets(long id,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item, and pins the shared (cached) instance to this node. What this means is that while other nodes will be able to read the same item, no node will be able to update it until until we end the transaction or release it.
id - The item’s ID.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid gets(long id,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item into a Persistable, and pins the shared (cached) instance to this node. What this means is that while other nodes will be able to read the same item, no node will be able to update it until until we end the transaction or release it.
id - The item’s ID.object - The object into which the contents of the item will be written.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionbyte[] gets(long id,
short nodeHint,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item with a hint as to its owner in the cluster, and pins the shared (cached) instance to this node. What this means is that while other nodes will be able to read the same item, no node will be able to update it until until we end the transaction or release it.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.nodeHint - The ID of the node the data item is probably owned by.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid gets(long id,
short nodeHint,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item into a Persistable with a hint as to its owner in the cluster, and pins the shared (cached) instance to this node. What this means is that while other nodes will be able to read the same item, no node will be able to update it until until we end the transaction or release it.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.nodeHint - The ID of the node the data item is probably owned by.txn - The current transaction. May be null, in which case you must later call release(id).object - The object into which the contents of the item will be written.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionbyte[] getsFromOwner(long id,
long ownerOf,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item with a hint as to its owner in the cluster, and pins the shared (cached) instance to this node. What this means is that while other nodes will be able to update it until until we end the transaction or release it. Unlike the direct hint given in gets(long, short, StoreTransaction), the hinted node here is the owner of a given item.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.ownerOf - The ID of an item whose owner is probably the owner of the requested item as well.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid getsFromOwner(long id,
long ownerOf,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item with a hint as to its owner in the cluster, and pins the shared (cached) instance to this node. What this means is that while other nodes will be able to read the same item, no node will be able to update it until until we end the transaction or release it.
Unlike the direct hint given in gets(long, short, Persistable, StoreTransaction), the hinted node here is the owner of a given item.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.ownerOf - The ID of an item whose owner is probably the owner of the requested item as well.object - The object into which the contents of the item will be written.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionbyte[] getx(long id,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item, makes this node its exclusive owner, and pins it. What this means is that no other node will be able to read or update the same item until until we end the transaction or release it. it.
id - The item’s ID.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid getx(long id,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item into a Persistable, makes this node its exclusive owner, and pins it. What this means is that no other node will be able to read or update the same item until until we end the transaction or release it.
id - The item’s ID.object - The object into which the contents of the item will be written.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionbyte[] getx(long id,
short nodeHint,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item with a hint as to its owner in the cluster, makes this node its exclusive owner, and pins it. What this means is that no other node will be able to read or update the same item until until we end the transaction or release it.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.nodeHint - The ID of the node the data item is probably owned by.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid getx(long id,
short nodeHint,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item with a hint as to its owner in the cluster, makes this node its exclusive owner, and pins it. What this means is that no other node will be able to read or update the same item until we end the transaction or release it.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.nodeHint - The ID of the node the data item is probably owned by.object - The object into which the contents of the item will be written.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionbyte[] getxFromOwner(long id,
long ownerOf,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item with a hint as to its owner in the cluster, makes this node its exclusive owner, and pins it. What this means is that no other node will be able to read or update the same item until we end the transaction or release it.
Unlike the direct hint given in getx(long, short, StoreTransaction), the hinted node here is the owner of a given item.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.ownerOf - The ID of an item whose owner is probably the owner of the requested item as well.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid getxFromOwner(long id,
long ownerOf,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Retrieves a given data item with a hint as to its owner in the cluster, makes this node its exclusive owner, and pins it. What this means is that no other node will be able to read or update the same item until we end the transaction or release it.
Unlike the direct hint given in getx(long, short, Persistable, StoreTransaction), the hinted node here is the owner of a given item.
If the item is indeed found on the hinted node, the retrieval performance might be superior. If not, the method will still work, but performance may be worse.
id - The item’s ID.ownerOf - The ID of an item whose owner is probably the owner of the requested item as well.object - The object into which the contents of the item will be written.txn - The current transaction. May be null, in which case you must later call release(id).co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid set(long id,
byte[] data,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Gains ownership of an item and sets its contents. Upon return from this method, the item will be pinned if and only if it had been pinned when the method was called.
id - The item’s ID.data - The contents to write into the item.txn - The current transaction. May be null.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid set(long id,
ByteBuffer data,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Gains ownership of an item and sets its contents. Upon return from this method, the item will be pinned if and only if it had been pinned when the method was called.
id - The item’s ID.data - The contents to write into the item.txn - The current transaction. May be null.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid set(long id,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Gains ownership of an item and sets its contents. Upon return from this method, the item will be pinned if and only if it had been pinned when the method was called.
id - The item’s ID.object - The contents to write into the item.txn - The current transaction. May be null.co.paralleluniverse.galaxy.TimeoutException - This exception is thrown if the operation has times-out.co.paralleluniverse.fibers.SuspendExecutionvoid del(long id,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
Deletes an item from the store.
id - txn - The current transaction. May be null.co.paralleluniverse.galaxy.TimeoutExceptionco.paralleluniverse.fibers.SuspendExecution<T> T invoke(long id,
co.paralleluniverse.galaxy.LineFunction<T> function)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
co.paralleluniverse.galaxy.TimeoutExceptionco.paralleluniverse.fibers.SuspendExecutionvoid push(long id,
short... toNodes)
Makes the given item available in the given nodes’ cache.
While this method is never necessary for the correct operation of the grid, in some special circumstances it might improve performance if we know that the given nodes will soon be interested in reading the item (e.g. as a result of a message we’re about to send them).
id - The ID of item to push.toNodes - The nodes to which the item is to be pushed.void pushx(long id,
short toNode)
Makes the given item available in the given node’s cache, and makes that node the owner of the item.
While this method is never necessary for the correct operation of the grid, in some special circumstances it might improve performance if we know that the given node will soon be interested in reading or updating the item (e.g. as a result of a message we’re about to send it).
id - The ID of item to push.toNode - The node to which the item is to be pushed.boolean isPinned(long id)
Tests whether an item is pinned on this node.
id - The item’s ID.true if the item is pinned; false otherwise.co.paralleluniverse.galaxy.ItemState getState(long id)
Returns an item’s state in the local store.
id - The item’s ID.