public interface IgniteInternalTx
'Ex'
stands for external).Modifier and Type | Interface and Description |
---|---|
static class |
IgniteInternalTx.FinalizationStatus |
Modifier and Type | Method and Description |
---|---|
boolean |
activeCachesDeploymentEnabled() |
void |
addInvalidPartition(GridCacheContext<?,?> cacheCtx,
int part) |
<T> T |
addMeta(int key,
T val)
Adds a new metadata.
|
Collection<IgniteTxEntry> |
allEntries() |
Collection<GridCacheVersion> |
alternateVersions() |
boolean |
colocated() |
IgniteInternalFuture<IgniteInternalTx> |
commitAsync()
Asynchronously commits this transaction by initiating
two-phase-commit process. |
void |
commitError(Throwable e) |
GridCacheVersion |
commitVersion() |
void |
commitVersion(GridCacheVersion commitVer) |
void |
completedVersions(GridCacheVersion base,
Collection<GridCacheVersion> committed,
Collection<GridCacheVersion> rolledback) |
TransactionConcurrency |
concurrency()
Cache transaction concurrency mode.
|
IgniteInternalFuture<?> |
currentPrepareFuture() |
boolean |
dht() |
boolean |
done() |
boolean |
empty() |
void |
endVersion(GridCacheVersion endVer) |
IgniteTxEntry |
entry(IgniteTxKey key) |
void |
errorWhenCommitting()
Changes transaction state from COMMITTING to MARKED_ROLLBACK.
|
UUID |
eventNodeId() |
IgniteInternalFuture<IgniteInternalTx> |
finishFuture() |
boolean |
hasWriteKey(IgniteTxKey key) |
boolean |
implicit()
Flag indicating whether transaction was started automatically by the
system or not.
|
boolean |
implicitSingle() |
boolean |
internal() |
void |
invalidate(boolean invalidate) |
Map<Integer,Set<Integer>> |
invalidPartitions() |
byte |
ioPolicy() |
boolean |
isInvalidate()
Get invalidation flag for this transaction.
|
TransactionIsolation |
isolation()
Cache transaction isolation level.
|
boolean |
isRollbackOnly()
If transaction was marked as rollback-only.
|
boolean |
isSystemInvalidate() |
boolean |
local() |
boolean |
localResult() |
boolean |
markFinalizing(IgniteInternalTx.FinalizationStatus status) |
Collection<UUID> |
masterNodeIds() |
<T> T |
meta(int key)
Gets metadata by key.
|
boolean |
near() |
GridCacheVersion |
nearXidVersion() |
boolean |
needsCompletedVersions() |
UUID |
nodeId()
ID of the node on which this transaction started.
|
boolean |
onePhaseCommit() |
boolean |
onOwnerChanged(GridCacheEntryEx entry,
GridCacheMvccCandidate owner)
Callback invoked whenever there is a lock that has been acquired
by this transaction for any of the participating entries.
|
boolean |
optimistic() |
Collection<IgniteTxEntry> |
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(IgniteTxKey key)
Gets owned version for near remote transaction.
|
boolean |
ownsLock(GridCacheEntryEx entry) |
boolean |
ownsLockUnsafe(GridCacheEntryEx entry) |
GridTuple<CacheObject> |
peek(GridCacheContext ctx,
boolean failFast,
KeyCacheObject key) |
boolean |
pessimistic() |
boolean |
readCommitted() |
Collection<IgniteTxEntry> |
readEntries() |
Map<IgniteTxKey,IgniteTxEntry> |
readMap() |
Set<IgniteTxKey> |
readSet() |
long |
remainingTime()
Gets allowed remaining time for this transaction.
|
<T> T |
removeMeta(int key)
Removes metadata by key.
|
boolean |
repeatableRead() |
IgniteInternalFuture<IgniteInternalTx> |
rollbackAsync()
Asynchronously rollback this transaction.
|
IgniteInternalFuture<?> |
salvageTx() |
void |
seal()
Seals transaction for updates.
|
boolean |
serializable() |
boolean |
setRollbackOnly()
Modify the transaction associated with the current thread such that the
only possible outcome of the transaction is to roll back the
transaction.
|
int |
size() |
long |
startTime()
Start time of this transaction.
|
TransactionState |
state()
Gets current transaction state value.
|
boolean |
state(TransactionState state) |
boolean |
storeEnabled() |
boolean |
storeWriteThrough() |
UUID |
subjectId() |
boolean |
system()
Checks if this is system cache transaction.
|
void |
systemInvalidate(boolean sysInvalidate) |
int |
taskNameHash()
Task name hash in case if transaction was initiated within task execution.
|
long |
threadId()
ID of the thread in which this transaction started.
|
boolean |
timedOut() |
long |
timeout()
Gets timeout value in milliseconds for this transaction.
|
long |
timeout(long timeout)
Sets transaction timeout value.
|
AffinityTopologyVersion |
topologyVersion() |
AffinityTopologyVersion |
topologyVersion(AffinityTopologyVersion topVer)
Attempts to set topology version and returns the current value.
|
AffinityTopologyVersion |
topologyVersionSnapshot() |
Map<UUID,Collection<UUID>> |
transactionNodes() |
IgniteTxState |
txState() |
boolean |
user() |
Collection<IgniteTxEntry> |
writeEntries() |
Map<IgniteTxKey,IgniteTxEntry> |
writeMap() |
Set<IgniteTxKey> |
writeSet() |
GridCacheVersion |
writeVersion() |
void |
writeVersion(GridCacheVersion ver)
Sets write version.
|
IgniteUuid |
xid()
Gets unique identifier for this transaction.
|
GridCacheVersion |
xidVersion() |
boolean localResult()
True
if transaction started on the node initiated cache operation.IgniteUuid xid()
UUID nodeId()
long threadId()
long startTime()
TransactionIsolation isolation()
TransactionConcurrency concurrency()
boolean implicit()
put(..)
or remove(..)
operation is invoked
outside of transaction.True
if transaction was started implicitly.boolean isInvalidate()
true
, then
remote values will be invalidated
(set to null
) instead
of updated.
Invalidation messages don't carry new values, so they are a lot lighter than update messages. However, when a value is accessed on a node after it's been invalidated, it must be loaded from persistent store.
TransactionState state()
long timeout()
IgniteTxTimeoutCheckedException
will be thrown.long timeout(long timeout)
timeout
- Transaction timeout value.void errorWhenCommitting()
boolean setRollbackOnly()
True
if rollback-only flag was set as a result of this operation,
false
if it was already set prior to this call or could not be set
because transaction is already finishing up committing or rolling back.boolean isRollbackOnly()
True
if transaction can only be rolled back.@Nullable <T> T removeMeta(int key)
T
- Type of the value.key
- Key of the metadata to remove.null
.@Nullable <T> T meta(int key)
T
- Type of the value.key
- Metadata key.null
.@Nullable <T> T addMeta(int key, T val)
T
- Type of the value.key
- Metadata key.val
- Metadata value.null
if there was none.int size()
boolean storeEnabled()
True
if transaction is allowed to use store.boolean storeWriteThrough()
True
if transaction is allowed to use store and transactions spans one or more caches with
store enabled.boolean system()
True
if transaction is started for system cache.byte ioPolicy()
AffinityTopologyVersion topologyVersion()
AffinityTopologyVersion topologyVersionSnapshot()
boolean implicitSingle()
IgniteTxState txState()
boolean activeCachesDeploymentEnabled()
true
or false
if the deployment is enabled or disabled for all active caches involved
in this transaction.AffinityTopologyVersion topologyVersion(AffinityTopologyVersion topVer)
topVer
- Topology version.boolean empty()
True
if transaction is empty.boolean markFinalizing(IgniteInternalTx.FinalizationStatus status)
status
- Finalization status to set.True
if could mark was set.void addInvalidPartition(GridCacheContext<?,?> cacheCtx, int part)
cacheCtx
- Cache context.part
- Invalid partition.@Nullable GridCacheVersion ownedVersion(IgniteTxKey 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 entry) throws GridCacheEntryRemovedException
entry
- Entry to check.True
if lock is owned.GridCacheEntryRemovedException
- If entry has been removed.boolean ownsLockUnsafe(GridCacheEntryEx entry)
entry
- Entry to check.True
if lock is owned.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.UUID subjectId()
int taskNameHash()
boolean user()
True
if transaction is user transaction, which means:
boolean hasWriteKey(IgniteTxKey key)
key
- Key to check.True
if key is present.Set<IgniteTxKey> readSet()
Set<IgniteTxKey> writeSet()
Collection<IgniteTxEntry> allEntries()
Collection<IgniteTxEntry> writeEntries()
Collection<IgniteTxEntry> readEntries()
Map<IgniteTxKey,IgniteTxEntry> writeMap()
Map<IgniteTxKey,IgniteTxEntry> readMap()
Collection<IgniteTxEntry> optimisticLockEntries()
void seal()
@Nullable IgniteTxEntry entry(IgniteTxKey key)
key
- Key for the entry.@Nullable GridTuple<CacheObject> peek(GridCacheContext ctx, boolean failFast, KeyCacheObject key) throws GridCacheFilterFailedException
ctx
- Cache context.failFast
- Fail-fast flag.key
- Key to look up.GridCacheFilterFailedException
- If filter failed and failFast is true
.GridCacheVersion xidVersion()
GridCacheVersion commitVersion()
void commitVersion(GridCacheVersion commitVer)
commitVer
- Commit version.@Nullable IgniteInternalFuture<?> salvageTx()
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.IgniteInternalFuture<IgniteInternalTx> finishFuture()
@Nullable IgniteInternalFuture<?> currentPrepareFuture()
boolean state(TransactionState 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()
IgniteInternalFuture<IgniteInternalTx> rollbackAsync()
IgniteInternalFuture<IgniteInternalTx> commitAsync()
two-phase-commit
process.boolean onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate 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.long remainingTime() throws IgniteTxTimeoutCheckedException
IgniteTxTimeoutCheckedException
- 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.void commitError(Throwable e)
e
- Commit error.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017