public class GridDhtColocatedTxLocal<K,V> extends GridDhtTxLocalAdapter<K,V>
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 |
|---|
GridDhtColocatedTxLocal()
Empty constructor, required by
Externalizable |
GridDhtColocatedTxLocal(boolean implicit,
boolean implicitSingle,
GridCacheContext<K,V> cctx,
GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
boolean syncCommit,
boolean syncRollback,
boolean swapEnabled,
boolean storeEnabled,
int txSize,
Object grpLockKey,
boolean partLock,
UUID subjId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGroupTxMapping(Collection<K> keys)
Adds key mapping to transaction.
|
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.
|
boolean |
colocated() |
GridFuture<GridCacheTx> |
commitAsync()
Asynchronously commits this transaction by initiating
two-phase-commit process. |
protected GridCacheEntryEx<K,V> |
entryEx(K key)
Gets cache entry for given key.
|
protected GridCacheEntryEx<K,V> |
entryEx(K key,
long topVer)
Gets cache entry for given key and topology version.
|
GridFuture<GridCacheTxEx<K,V>> |
future() |
GridFuture<Boolean> |
loadMissing(boolean async,
Collection<? extends K> keys,
GridBiInClosure<K,V> c) |
protected GridUuid |
nearFutureId() |
protected GridUuid |
nearMiniId() |
protected UUID |
nearNodeId() |
GridCacheVersion |
nearXidVersion() |
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.
|
boolean |
ownsLock(GridCacheEntryEx<K,V> entry) |
boolean |
ownsLockUnsafe(GridCacheEntryEx<K,V> entry) |
GridFuture<GridCacheTxEx<K,V>> |
prepareAsync()
Prepare stage.
|
GridFuture<GridCacheTxEx<K,V>> |
prepareAsyncLocal(Collection<GridCacheTxEntry<K,V>> reads,
Collection<GridCacheTxEntry<K,V>> writes,
Map<UUID,Collection<UUID>> txNodes,
boolean last,
Collection<UUID> lastBackups)
Prepares next batch of entries in dht transaction.
|
Collection<GridCacheTxEntry<K,V>> |
recoveryWrites()
Gets pessimistic recovery writes, i.e.
|
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() |
protected void |
updateExplicitVersion(GridCacheTxEntry<K,V> txEntry,
GridCacheEntryEx<K,V> entry)
Updates explicit version for tx entry based on current entry lock owner.
|
addEntry, addInvalidPartition, addLocalCandidates, finish, localCandidates, mapExplicitLocks, needsCompletedVersions, needsCompletedVersions, pendingVersions, pendingVersions, removeMapping, rollback, syncCommit, syncRollbackaddEntry, allEntries, alternateVersions, batchStoreCommit, checkValid, commit, commitAfterLock, commitError, commitError, committedVersions, completedBase, completedVersions, empty, enlistWrite, entry, eventNodeId, getAllAsync, groupLockAsync, hasReadKey, hasWriteKey, init, isBatchUpdate, isSingleUpdate, isStarted, masterNodeIds, minVersion, onOwnerChanged, originatingNodeId, 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, commitVersion, commitVersion, concurrency, dht, 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, otherNodeId, ownedVersion, pessimistic, readCommitted, readExternal, readResolve, recoveryWrites, remainingTime, repeatableRead, replicated, serializable, setRollbackOnly, signalAll, size, startTime, startVersion, state, state, subjectId, systemInvalidate, threadId, timedOut, timeout, timeout, timeoutId, topologyVersion, topologyVersion, transactionNodes, unlock, updateNearCache, 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, waitgroupLockEntrycommitVersion, commitVersion, dht, done, endVersion, endVersion, enforceSerializable, finishFuture, groupLock, groupLockKey, implicitSingle, internal, invalidate, invalidPartitions, isSystemInvalidate, local, markFinalizing, markPreparing, near, onePhaseCommit, optimistic, otherNodeId, ownedVersion, pessimistic, readCommitted, remainingTime, repeatableRead, replicated, serializable, size, startVersion, state, subjectId, systemInvalidate, timedOut, topologyVersion, topologyVersion, transactionNodes, 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 GridDhtColocatedTxLocal()
Externalizablepublic GridDhtColocatedTxLocal(boolean implicit,
boolean implicitSingle,
GridCacheContext<K,V> cctx,
GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
boolean syncCommit,
boolean syncRollback,
boolean swapEnabled,
boolean storeEnabled,
int txSize,
@Nullable
Object grpLockKey,
boolean partLock,
@Nullable
UUID subjId)
implicit - Implicit flag.implicitSingle - Implicit-with-single-key flag.cctx - Cache context.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.invalidate - Invalidation policy.syncCommit - Synchronous commit flag.syncRollback - Synchronous rollback flag.swapEnabled - Flag indicating whether swap is enabled or not.storeEnabled - Flag indicating whether store is enabled or not.txSize - Expected transaction size.grpLockKey - Group lock key if this is a group-lock transaction.partLock - True if this is a group-lock transaction and whole partition should be locked.public boolean colocated()
colocated in interface GridCacheTxEx<K,V>colocated in class GridCacheTxAdapter<K,V>True if dht colocated transaction.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 Collection<GridCacheTxEntry<K,V>> recoveryWrites()
recoveryWrites in interface GridCacheTxEx<K,V>recoveryWrites in class GridCacheTxAdapter<K,V>protected GridUuid nearFutureId()
nearFutureId in class GridDhtTxLocalAdapter<K,V>protected GridUuid nearMiniId()
nearMiniId in class GridDhtTxLocalAdapter<K,V>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 sendFinishReply(boolean commit,
@Nullable
Throwable err)
sendFinishReply in class GridDhtTxLocalAdapter<K,V>commit - Commit flag.err - Error, if any.protected void clearPrepareFuture(GridDhtTxPrepareFuture<K,V> fut)
clearPrepareFuture in class GridDhtTxLocalAdapter<K,V>fut - Expected future.public GridFuture<GridCacheTxEx<K,V>> future()
public boolean ownsLockUnsafe(GridCacheEntryEx<K,V> entry)
ownsLockUnsafe in interface GridCacheTxEx<K,V>ownsLockUnsafe in class GridCacheTxAdapter<K,V>entry - Entry to check.True if lock is owned.public boolean ownsLock(GridCacheEntryEx<K,V> entry) throws GridCacheEntryRemovedException
ownsLock in interface GridCacheTxEx<K,V>ownsLock in class GridCacheTxAdapter<K,V>entry - Entry to check.True if lock is owned.GridCacheEntryRemovedException - If entry has been removed.public Collection<GridCacheTxEntry<K,V>> optimisticLockEntries()
optimisticLockEntries in interface GridCacheTxEx<K,V>optimisticLockEntries in class GridCacheTxAdapter<K,V>public GridFuture<Boolean> loadMissing(boolean async, Collection<? extends K> keys, GridBiInClosure<K,V> c)
loadMissing in interface GridCacheTxLocalEx<K,V>loadMissing in class GridCacheTxLocalAdapter<K,V>async - if True, then loading will happen in a separate thread.keys - Keys.c - Closure.True value if loading took place.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()
public GridFuture<GridCacheTx> commitAsync()
two-phase-commit process.public GridFuture<GridCacheTx> rollbackAsync()
public GridFuture<GridCacheTxEx<K,V>> prepareAsyncLocal(@Nullable Collection<GridCacheTxEntry<K,V>> reads, @Nullable Collection<GridCacheTxEntry<K,V>> writes, Map<UUID,Collection<UUID>> txNodes, boolean last, Collection<UUID> lastBackups)
reads - Read entries.writes - Write entries.txNodes - Transaction nodes mapping.last - True if this is last prepare request.lastBackups - IDs of backup nodes receiving last prepare request.protected void addGroupTxMapping(Collection<K> keys)
addGroupTxMapping in class GridDhtTxLocalAdapter<K,V>keys - Keys to add.protected GridCacheEntryEx<K,V> entryEx(K key)
entryEx in class GridCacheTxLocalAdapter<K,V>key - Key.protected GridCacheEntryEx<K,V> entryEx(K key, long topVer)
entryEx in class GridCacheTxLocalAdapter<K,V>key - Key.topVer - Topology version.public String toString()
toString in class GridDhtTxLocalAdapter<K,V>Copyright © 2014. All rights reserved.