public interface GridCacheTxEx<K,V> extends GridCacheTx, GridTimeoutObject
'Ex' stands for external).| Modifier and Type | Interface and Description |
|---|---|
static class |
GridCacheTxEx.FinalizationStatus |
| Modifier and Type | Method and Description |
|---|---|
void |
addInvalidPartition(int part) |
void |
addLocalCandidates(K key,
Collection<GridCacheMvccCandidate<K>> cands) |
Collection<GridCacheTxEntry<K,V>> |
allEntries() |
Collection<GridCacheVersion> |
alternateVersions() |
boolean |
colocated() |
GridCacheVersion |
commitVersion() |
boolean |
commitVersion(GridCacheVersion commitVer) |
void |
completedVersions(GridCacheVersion base,
Collection<GridCacheVersion> committed,
Collection<GridCacheVersion> rolledback) |
boolean |
dht() |
boolean |
done() |
boolean |
empty() |
GridCacheVersion |
endVersion() |
void |
endVersion(GridCacheVersion endVer) |
boolean |
enforceSerializable()
For Partitioned caches, this flag is
false for remote DHT and remote NEAR
transactions because serializability of transaction is enforced on primary node. |
GridCacheTxEntry<K,V> |
entry(K key) |
UUID |
eventNodeId() |
GridFuture<GridCacheTx> |
finishFuture() |
boolean |
groupLock() |
Object |
groupLockKey() |
boolean |
hasReadKey(K key) |
boolean |
hasWriteKey(K key) |
boolean |
implicitSingle() |
boolean |
internal() |
void |
invalidate(boolean invalidate) |
Set<Integer> |
invalidPartitions() |
boolean |
isSystemInvalidate() |
boolean |
local() |
Map<K,Collection<GridCacheMvccCandidate<K>>> |
localCandidates() |
boolean |
markFinalizing(GridCacheTxEx.FinalizationStatus status) |
boolean |
markPreparing() |
Collection<UUID> |
masterNodeIds() |
boolean |
near() |
GridCacheVersion |
nearXidVersion() |
boolean |
needsCompletedVersions() |
boolean |
onePhaseCommit() |
boolean |
onOwnerChanged(GridCacheEntryEx<K,V> entry,
GridCacheMvccCandidate<K> owner)
Callback invoked whenever there is a lock that has been acquired
by this transaction for any of the participating entries.
|
boolean |
optimistic() |
Collection<GridCacheTxEntry<K,V>> |
optimisticLockEntries()
Gets a list of entries that needs to be locked on the next step of prepare stage of
optimistic transaction.
|
UUID |
originatingNodeId()
Gets node ID which directly started this transaction.
|
UUID |
otherNodeId()
Gets ID of additional node involved.
|
GridCacheVersion |
ownedVersion(K key)
Gets owned version for near remote transaction.
|
boolean |
ownsLock(GridCacheEntryEx<K,V> entry) |
boolean |
ownsLockUnsafe(GridCacheEntryEx<K,V> entry) |
GridTuple<V> |
peek(boolean failFast,
K key,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
boolean |
pessimistic() |
void |
prepare()
Prepare state.
|
GridFuture<GridCacheTxEx<K,V>> |
prepareAsync()
Prepare stage.
|
boolean |
readCommitted() |
Collection<GridCacheTxEntry<K,V>> |
readEntries() |
Map<K,GridCacheTxEntry<K,V>> |
readMap() |
Set<K> |
readSet() |
Collection<GridCacheTxEntry<K,V>> |
recoveryWrites()
Gets pessimistic recovery writes, i.e.
|
long |
remainingTime()
Gets allowed remaining time for this transaction.
|
boolean |
removed(K key)
Checks whether given key has been removed within transaction.
|
boolean |
repeatableRead() |
boolean |
replicated() |
GridFuture<GridCacheTx> |
rollbackAsync()
TODO-gg-4004 Put rollback async on public API?
Asynchronously rollback this transaction.
|
void |
seal()
Seals transaction for updates.
|
boolean |
serializable() |
int |
size() |
GridCacheVersion |
startVersion() |
boolean |
state(GridCacheTxState state) |
UUID |
subjectId() |
boolean |
syncCommit() |
boolean |
syncRollback() |
void |
systemInvalidate(boolean sysInvalidate) |
boolean |
timedOut() |
long |
topologyVersion() |
long |
topologyVersion(long topVer)
Attempts to set topology version and returns the current value.
|
Map<UUID,Collection<UUID>> |
transactionNodes() |
boolean |
user() |
Collection<GridCacheTxEntry<K,V>> |
writeEntries() |
Map<K,GridCacheTxEntry<K,V>> |
writeMap() |
Set<K> |
writeSet() |
GridCacheVersion |
writeVersion() |
void |
writeVersion(GridCacheVersion ver)
Sets write version.
|
GridCacheVersion |
xidVersion() |
close, commit, commitAsync, concurrency, implicit, isInvalidate, isolation, isRollbackOnly, nodeId, rollback, setRollbackOnly, startTime, state, threadId, timeout, timeout, xidaddMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMetaendTime, onTimeout, timeoutIdint size()
long topologyVersion()
boolean implicitSingle()
long topologyVersion(long topVer)
topVer - Topology version.boolean empty()
True if transaction is empty.boolean groupLock()
True if transaction group-locked.@Nullable Object groupLockKey()
groupLock() is true.boolean markPreparing()
True if preparing flag was set with this call.boolean markFinalizing(GridCacheTxEx.FinalizationStatus status)
status - Finalization status to set.True if could mark was set.void addInvalidPartition(int part)
part - Invalid partition.@Nullable GridCacheVersion ownedVersion(K key)
key - Key to get version for.@Nullable UUID otherNodeId()
UUID eventNodeId()
UUID originatingNodeId()
Collection<UUID> masterNodeIds()
@Nullable GridCacheVersion nearXidVersion()
@Nullable Map<UUID,Collection<UUID>> transactionNodes()
boolean ownsLock(GridCacheEntryEx<K,V> entry) throws GridCacheEntryRemovedException
entry - Entry to check.True if lock is owned.GridCacheEntryRemovedException - If entry has been removed.boolean ownsLockUnsafe(GridCacheEntryEx<K,V> entry)
entry - Entry to check.True if lock is owned.boolean enforceSerializable()
false for remote DHT and remote NEAR
transactions because serializability of transaction is enforced on primary node. All
other transaction types must enforce it.boolean near()
True if near transaction.boolean dht()
True if DHT transaction.boolean colocated()
True if dht colocated transaction.boolean local()
True if transaction is local, false if it's remote.boolean replicated()
True if transaction is replicated.UUID subjectId()
boolean user()
True if transaction is user transaction, which means:
boolean syncCommit()
True if transaction is configured with synchronous commit flag.boolean syncRollback()
True if transaction is configured with synchronous rollback flag.boolean hasReadKey(K key)
key - Key to check.True if key is present.boolean hasWriteKey(K key)
key - Key to check.True if key is present.Collection<GridCacheTxEntry<K,V>> allEntries()
Collection<GridCacheTxEntry<K,V>> writeEntries()
Collection<GridCacheTxEntry<K,V>> readEntries()
Map<K,GridCacheTxEntry<K,V>> writeMap()
Map<K,GridCacheTxEntry<K,V>> readMap()
Collection<GridCacheTxEntry<K,V>> recoveryWrites()
Collection<GridCacheTxEntry<K,V>> optimisticLockEntries()
void seal()
@Nullable GridCacheTxEntry<K,V> entry(K key)
key - Key for the entry.@Nullable GridTuple<V> peek(boolean failFast, K key, @Nullable GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridCacheFilterFailedException
failFast - Fail-fast flag.key - Key to look up.filter - Filter to check.GridCacheFilterFailedException - If filter failed and failFast is true.GridCacheVersion startVersion()
GridCacheVersion xidVersion()
GridCacheVersion commitVersion()
boolean commitVersion(GridCacheVersion commitVer)
commitVer - Commit version.True if version was set.GridCacheVersion endVersion()
void prepare()
throws GridException
GridException - If failed.GridFuture<GridCacheTxEx<K,V>> prepareAsync()
void endVersion(GridCacheVersion endVer)
endVer - End version (a.k.a. 'tnc' or 'transaction number counter')
assigned to this transaction at the end of write phase.GridCacheVersion writeVersion()
xidVersion().void writeVersion(GridCacheVersion ver)
ver - Write version.GridFuture<GridCacheTx> finishFuture()
boolean state(GridCacheTxState state)
state - Transaction state.True if transition was valid, false otherwise.void invalidate(boolean invalidate)
invalidate - Invalidate flag.void systemInvalidate(boolean sysInvalidate)
sysInvalidate - System invalidate flag.boolean isSystemInvalidate()
GridFuture<GridCacheTx> rollbackAsync()
void addLocalCandidates(K key, Collection<GridCacheMvccCandidate<K>> cands)
key - Cache key.cands - Collection of lock candidates for that key.Map<K,Collection<GridCacheMvccCandidate<K>>> localCandidates()
boolean onOwnerChanged(GridCacheEntryEx<K,V> entry, GridCacheMvccCandidate<K> owner)
entry - Cache entry.owner - Lock candidate that won ownership of the lock.True if transaction cared about notification.boolean timedOut()
True if transaction timed out.boolean done()
True if transaction had completed successfully or unsuccessfully.boolean optimistic()
True for OPTIMISTIC transactions.boolean pessimistic()
True for PESSIMISTIC transactions.boolean readCommitted()
True if read-committed.boolean repeatableRead()
True if repeatable-read.boolean serializable()
True if serializable.boolean removed(K key)
key - Key to check.True if key has been removed.long remainingTime()
throws GridCacheTxTimeoutException
GridCacheTxTimeoutException - If transaction timed out.Collection<GridCacheVersion> alternateVersions()
boolean needsCompletedVersions()
True if transaction needs completed versions for processing.void completedVersions(GridCacheVersion base, Collection<GridCacheVersion> committed, Collection<GridCacheVersion> rolledback)
base - Base for committed versions.committed - Committed transactions relative to base.rolledback - Rolled back transactions relative to base.boolean internal()
True if transaction has at least one internal entry.boolean onePhaseCommit()
True if transaction is a one-phase-commit transaction.Copyright © 2014. All rights reserved.