public class GridDhtTxLocal<K,V> extends GridDhtTxLocalAdapter<K,V> implements GridCacheMappedVersion
GridCacheTxLocalAdapter.FinishClosure<T>, GridCacheTxLocalAdapter.PLC1<T>, GridCacheTxLocalAdapter.PLC2<T>, GridCacheTxLocalAdapter.PMC<T>, GridCacheTxLocalAdapter.PostLockClosure1<T>, GridCacheTxLocalAdapter.PostLockClosure2<T>, GridCacheTxLocalAdapter.PostMissClosure<T>GridCacheTxEx.FinalizationStatusdhtMap, nearMapcommitErr, doneFlag, minVer, readView, txMap, writeViewcctx, concurrency, endVer, grpLockKey, implicit, implicitSingle, internal, invalidate, isDone, isolation, loc, log, nodeId, onePhaseCommit, startTime, startVer, storeEnabled, subjId, swapOrOffheapEnabled, threadId, timeout, txSize, writeVer, xidVer| Constructor and Description |
|---|
GridDhtTxLocal()
Empty constructor required for
Externalizable. |
| Modifier and Type | Method and Description |
|---|---|
protected GridFuture<Boolean> |
addReader(long msgId,
GridDhtCacheEntry<K,V> cached,
GridCacheTxEntry<K,V> entry,
long topVer)
Adds reader to cached entry.
|
protected void |
clearPrepareFuture(GridDhtTxPrepareFuture<K,V> fut)
Removes previously created prepare future from atomic reference.
|
GridFuture<GridCacheTx> |
commitAsync()
Asynchronously commits this transaction by initiating
two-phase-commit process. |
boolean |
dht() |
UUID |
eventNodeId() |
boolean |
finish(boolean commit)
Finishes transaction (either commit or rollback).
|
GridFuture<GridCacheTxEx<K,V>> |
future() |
protected boolean |
isBatchUpdate() |
protected boolean |
isSingleUpdate() |
GridCacheVersion |
mappedVersion()
Mapping should occur only if this interface returns a non-null value.
|
Collection<UUID> |
masterNodeIds() |
GridUuid |
nearFinishFutureId() |
void |
nearFinishFutureId(GridUuid nearFinFutId) |
GridUuid |
nearFinishMiniId() |
void |
nearFinishMiniId(GridUuid nearFinMiniId) |
protected GridUuid |
nearFutureId() |
protected GridUuid |
nearMiniId() |
protected UUID |
nearNodeId() |
GridCacheVersion |
nearXidVersion() |
UUID |
originatingNodeId()
Gets node ID which directly started this transaction.
|
UUID |
otherNodeId()
Gets ID of additional node involved.
|
GridFuture<GridCacheTxEx<K,V>> |
prepareAsync()
Prepare stage.
|
GridFuture<GridCacheTxEx<K,V>> |
prepareAsync(Iterable<GridCacheTxEntry<K,V>> reads,
Iterable<GridCacheTxEntry<K,V>> writes,
Map<K,GridCacheVersion> verMap,
long msgId,
GridUuid nearMiniId,
Map<UUID,Collection<UUID>> txNodes,
boolean last,
Collection<UUID> lastBackups)
Prepares next batch of entries in dht transaction.
|
GridFuture<GridCacheTx> |
rollbackAsync()
TODO-gg-4004 Put rollback async on public API?
Asynchronously rollback this transaction.
|
protected void |
sendFinishReply(boolean commit,
Throwable err) |
String |
toString() |
Map<UUID,Collection<UUID>> |
transactionNodes() |
protected void |
updateExplicitVersion(GridCacheTxEntry<K,V> txEntry,
GridCacheEntryEx<K,V> entry)
Updates explicit version for tx entry based on current entry lock owner.
|
protected boolean |
updateNearCache()
Checks whether near cache should be updated.
|
addEntry, addGroupTxMapping, addInvalidPartition, addLocalCandidates, localCandidates, mapExplicitLocks, needsCompletedVersions, needsCompletedVersions, pendingVersions, pendingVersions, removeMapping, rollback, syncCommit, syncRollbackaddEntry, allEntries, alternateVersions, batchStoreCommit, checkValid, commit, commitAfterLock, commitError, commitError, committedVersions, completedBase, completedVersions, empty, enlistWrite, entry, entryEx, entryEx, getAllAsync, groupLockAsync, hasReadKey, hasWriteKey, init, isStarted, loadMissing, minVersion, onOwnerChanged, partitionLock, peek, postLockWrite, prepare, put, putAll, putAllAsync, putAllDr, putAllDrAsync, putAsync, putAsync, putx, putx, putxAsync, putxAsync, putxAsync0, readEntries, readMap, readSet, remove, removeAll, removeAllAsync, removeAllDr, removeAllDrAsync, removeAsync, removed, removex, removexAsync, removexAsync0, rolledbackVersions, seal, sendTransformedValues, tmCommit, transform, transformAll, transformAllAsync, transformAsync, transformCompute, userCommit, userPrepare, userRollback, writeEntries, writeMap, writeSetapplyTransformClosures, awaitCompletion, awaitSignal, awaitSignal, checkInternal, close, colocated, commitVersion, commitVersion, concurrency, done, drResolveConflict, endTime, endVersion, endVersion, enforceSerializable, equals, evictNearEntry, finalizationStatus, finishFuture, groupLock, groupLockEntry, groupLockKey, hashCode, implicit, implicitSingle, initCommitVersion, internal, invalidate, invalidPartitions, isInvalidate, isNearLocallyMapped, isolation, isRollbackOnly, isSystemInvalidate, local, lock, lockTimeout, log, markFinalizing, markPreparing, near, nodeId, onePhaseCommit, onePhaseCommit, onTimeout, optimistic, optimisticLockEntries, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, readCommitted, readExternal, readResolve, recoveryWrites, recoveryWrites, remainingTime, repeatableRead, replicated, serializable, setRollbackOnly, signalAll, size, startTime, startVersion, state, state, subjectId, systemInvalidate, threadId, timedOut, timeout, timeout, timeoutId, topologyVersion, topologyVersion, unlock, user, writeExternal, writeVersion, writeVersion, xid, xidVersionaddMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, readExternalMeta, removeMeta, removeMeta, replaceMeta, writeExternalMetafinalize, getClass, notify, notifyAll, wait, wait, waitgroupLockEntrycolocated, commitVersion, commitVersion, done, endVersion, endVersion, enforceSerializable, finishFuture, groupLock, groupLockKey, implicitSingle, internal, invalidate, invalidPartitions, isSystemInvalidate, local, markFinalizing, markPreparing, near, onePhaseCommit, optimistic, optimisticLockEntries, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, readCommitted, recoveryWrites, remainingTime, repeatableRead, replicated, serializable, size, startVersion, state, subjectId, systemInvalidate, timedOut, topologyVersion, topologyVersion, user, writeVersion, writeVersion, xidVersionclose, concurrency, implicit, isInvalidate, isolation, isRollbackOnly, nodeId, setRollbackOnly, startTime, state, threadId, timeout, timeout, xidaddMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMetaendTime, onTimeout, timeoutIdpublic GridDhtTxLocal()
Externalizable.public Map<UUID,Collection<UUID>> transactionNodes()
transactionNodes in interface GridCacheTxEx<K,V>transactionNodes in class GridCacheTxAdapter<K,V>public UUID eventNodeId()
eventNodeId in interface GridCacheTxEx<K,V>eventNodeId in class GridCacheTxLocalAdapter<K,V>public Collection<UUID> masterNodeIds()
masterNodeIds in interface GridCacheTxEx<K,V>masterNodeIds in class GridCacheTxLocalAdapter<K,V>public UUID otherNodeId()
otherNodeId in interface GridCacheTxEx<K,V>otherNodeId in class GridCacheTxAdapter<K,V>public UUID originatingNodeId()
originatingNodeId in interface GridCacheTxEx<K,V>originatingNodeId in class GridCacheTxLocalAdapter<K,V>protected UUID nearNodeId()
nearNodeId in class GridDhtTxLocalAdapter<K,V>public GridCacheVersion nearXidVersion()
nearXidVersion in interface GridCacheTxEx<K,V>nearXidVersion in class GridCacheTxAdapter<K,V>public GridCacheVersion mappedVersion()
mappedVersion in interface GridCacheMappedVersionprotected GridUuid nearFutureId()
nearFutureId in class GridDhtTxLocalAdapter<K,V>protected GridUuid nearMiniId()
nearMiniId in class GridDhtTxLocalAdapter<K,V>public boolean dht()
dht in interface GridCacheTxEx<K,V>dht in class GridCacheTxAdapter<K,V>True if DHT transaction.protected boolean isBatchUpdate()
isBatchUpdate in class GridCacheTxLocalAdapter<K,V>True if updates should be batched up.protected boolean isSingleUpdate()
isSingleUpdate in class GridCacheTxLocalAdapter<K,V>True if updates should be done individually.protected boolean updateNearCache()
updateNearCache in class GridCacheTxAdapter<K,V>public GridUuid nearFinishFutureId()
public void nearFinishFutureId(GridUuid nearFinFutId)
nearFinFutId - Near future ID.public GridUuid nearFinishMiniId()
public GridFuture<GridCacheTxEx<K,V>> future()
future in interface GridCacheTxLocalEx<K,V>public void nearFinishMiniId(GridUuid nearFinMiniId)
nearFinMiniId - Near future mini ID.@Nullable protected GridFuture<Boolean> addReader(long msgId, GridDhtCacheEntry<K,V> cached, GridCacheTxEntry<K,V> entry, long topVer)
addReader in class GridDhtTxLocalAdapter<K,V>msgId - Message ID.cached - Cached entry.entry - Transaction entry.True if reader was added as a result of this call.protected void updateExplicitVersion(GridCacheTxEntry<K,V> txEntry, GridCacheEntryEx<K,V> entry) throws GridCacheEntryRemovedException
updateExplicitVersion in class GridCacheTxLocalAdapter<K,V>txEntry - Tx entry to update.entry - Entry.GridCacheEntryRemovedException - If entry was concurrently removed.public GridFuture<GridCacheTxEx<K,V>> prepareAsync()
prepareAsync in interface GridCacheTxEx<K,V>public GridFuture<GridCacheTxEx<K,V>> prepareAsync(@Nullable Iterable<GridCacheTxEntry<K,V>> reads, @Nullable Iterable<GridCacheTxEntry<K,V>> writes, Map<K,GridCacheVersion> verMap, long msgId, GridUuid nearMiniId, Map<UUID,Collection<UUID>> txNodes, boolean last, Collection<UUID> lastBackups)
reads - Read entries.writes - Write entries.verMap - Version map.msgId - Message ID.nearMiniId - Near mini future ID.txNodes - Transaction nodes mapping.last - True if this is last prepare request.lastBackups - IDs of backup nodes receiving last prepare request.public GridFuture<GridCacheTx> commitAsync()
two-phase-commit process.commitAsync in interface GridCacheTxprotected void clearPrepareFuture(GridDhtTxPrepareFuture<K,V> fut)
clearPrepareFuture in class GridDhtTxLocalAdapter<K,V>fut - Expected future.public GridFuture<GridCacheTx> rollbackAsync()
rollbackAsync in interface GridCacheTxEx<K,V>public boolean finish(boolean commit)
throws GridException
finish in interface GridCacheTxLocalEx<K,V>finish in class GridDhtTxLocalAdapter<K,V>commit - True if commit, false if rollback.True if state has been changed.GridException - If finish failed.protected void sendFinishReply(boolean commit,
@Nullable
Throwable err)
sendFinishReply in class GridDhtTxLocalAdapter<K,V>commit - Commit flag.err - Error, if any.public String toString()
toString in class GridDhtTxLocalAdapter<K,V>Copyright © 2014. All rights reserved.