| Constructor and Description |
|---|
StoreImpl(co.paralleluniverse.galaxy.Store 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.
|
public long alloc(int count,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreAllocates 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.alloc in interface Storecount - 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.SuspendExecutionpublic long put(byte[] data,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StorePuts a new item into the store and returns its (newly allocated) ID.
put in interface Storedata - 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.SuspendExecutionpublic long put(ByteBuffer data, co.paralleluniverse.galaxy.StoreTransaction txn) throws co.paralleluniverse.galaxy.TimeoutException, co.paralleluniverse.fibers.SuspendExecution
StorePuts a new item into the store and returns its (newly allocated) ID.
put in interface Storedata - 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.SuspendExecutionpublic long put(co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StorePuts a new item into the store and returns its (newly allocated) ID.
put in interface Storeobject - 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.SuspendExecutionpublic byte[] get(long id)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves a given data item.
public void get(long id,
co.paralleluniverse.common.io.Persistable object)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves a given data item into a Persistable.
public byte[] get(long id,
short nodeHint)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
get in interface Storeid - 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.SuspendExecutionpublic void get(long id,
short nodeHint,
co.paralleluniverse.common.io.Persistable object)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
get in interface Storeid - 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.SuspendExecutionpublic byte[] getFromOwner(long id,
long ownerOf)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
getFromOwner in interface Storeid - 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.SuspendExecutionpublic void getFromOwner(long id,
long ownerOf,
co.paralleluniverse.common.io.Persistable object)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
getFromOwner in interface Storeid - 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.SuspendExecutionpublic byte[] gets(long id,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
gets in interface Storeid - 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.SuspendExecutionpublic void gets(long id,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
gets in interface Storeid - 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.SuspendExecutionpublic byte[] gets(long id,
short nodeHint,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
gets in interface Storeid - 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.SuspendExecutionpublic void 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
StoreRetrieves 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.
gets in interface Storeid - 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.SuspendExecutionpublic byte[] getsFromOwner(long id,
long ownerOf,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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 Store.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.
getsFromOwner in interface Storeid - 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.SuspendExecutionpublic void 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
StoreRetrieves 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 Store.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.
getsFromOwner in interface Storeid - 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.SuspendExecutionpublic byte[] getx(long id,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
getx in interface Storeid - 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.SuspendExecutionpublic void getx(long id,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
getx in interface Storeid - 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.SuspendExecutionpublic byte[] getx(long id,
short nodeHint,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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.
getx in interface Storeid - 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.SuspendExecutionpublic void 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
StoreRetrieves 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.
getx in interface Storeid - 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.SuspendExecutionpublic byte[] getxFromOwner(long id,
long ownerOf,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreRetrieves 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 Store.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.
getxFromOwner in interface Storeid - 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.SuspendExecutionpublic void 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
StoreRetrieves 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 Store.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.
getxFromOwner in interface Storeid - 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.SuspendExecutionpublic void set(long id,
byte[] data,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreGains 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.
set in interface Storeid - 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.SuspendExecutionpublic void set(long id,
ByteBuffer data,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreGains 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.
set in interface Storeid - 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.SuspendExecutionpublic void set(long id,
co.paralleluniverse.common.io.Persistable object,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreGains 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.
set in interface Storeid - 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.SuspendExecutionpublic <T> T invoke(long id,
co.paralleluniverse.galaxy.LineFunction<T> function)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
public void del(long id,
co.paralleluniverse.galaxy.StoreTransaction txn)
throws co.paralleluniverse.galaxy.TimeoutException,
co.paralleluniverse.fibers.SuspendExecution
StoreDeletes an item from the store.
public int getMaxItemSize()
StoreReturns 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.
getMaxItemSize in interface Storepublic co.paralleluniverse.galaxy.StoreTransaction beginTransaction()
StoreCreates a new transaction.
A transaction can be used by more than one thread.
beginTransaction in interface Storepublic void commit(co.paralleluniverse.galaxy.StoreTransaction txn)
throws InterruptedException
StoreEnds a transaction, and makes all updates visible by all other nodes in the cluster.
commit in interface Storetxn - The current transaction, which we wish to complete.InterruptedExceptionpublic void abort(co.paralleluniverse.galaxy.StoreTransaction txn)
throws InterruptedException
StoreEnds a transaction after a failure.
This method must be called only after rollback() has been called, or a manual rollback has been done.
abort in interface Storetxn - The current transaction, which we wish to complete after failure.InterruptedExceptionpublic void rollback(co.paralleluniverse.galaxy.StoreTransaction txn)
StoreReverts set operations that were performed during the transactions.
This method does not complete the transaction. endTransaction() must still be called.
public void release(long id)
StoreReleases 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.
public long getRoot(String rootName, co.paralleluniverse.galaxy.StoreTransaction txn) throws co.paralleluniverse.galaxy.TimeoutException
StoreGets 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 .public boolean isRootCreated(long rootId,
co.paralleluniverse.galaxy.StoreTransaction txn)
StoreTests whether a root item has been newly created.
isRootCreated in interface StorerootId - 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.public void setListener(long id,
co.paralleluniverse.galaxy.CacheListener listener)
StoreSets a listener listening for local cache events on the given item.
setListener in interface Storeid - The item’s ID.listener - The listener.public void push(long id,
short... toNodes)
StoreMakes 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).
public void pushx(long id,
short toNode)
StoreMakes 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).
public boolean isPinned(long id)
StoreTests whether an item is pinned on this node.