public abstract class GridDhtTxLocalAdapter<K,V> extends GridCacheTxLocalAdapter<K,V>
GridCacheTxLocalAdapter.FinishClosure<T>, GridCacheTxLocalAdapter.PLC1<T>, GridCacheTxLocalAdapter.PLC2<T>, GridCacheTxLocalAdapter.PMC<T>, GridCacheTxLocalAdapter.PostLockClosure1<T>, GridCacheTxLocalAdapter.PostLockClosure2<T>, GridCacheTxLocalAdapter.PostMissClosure<T>GridCacheTxEx.FinalizationStatus| Modifier and Type | Field and Description |
|---|---|
protected Map<UUID,GridDistributedTxMapping<K,V>> |
dhtMap
DHT mappings.
|
protected Map<UUID,GridDistributedTxMapping<K,V>> |
nearMap
Near mappings.
|
commitErr, 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| Modifier | Constructor and Description |
|---|---|
protected |
GridDhtTxLocalAdapter()
Empty constructor required for
Externalizable. |
protected |
GridDhtTxLocalAdapter(GridCacheVersion xidVer,
boolean implicit,
boolean implicitSingle,
GridCacheContext<K,V> cctx,
GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
boolean syncCommit,
boolean syncRollback,
boolean explicitLock,
boolean swapEnabled,
boolean storeEnabled,
int txSize,
Object grpLockKey,
boolean partLock,
UUID subjId) |
| Modifier and Type | Method and Description |
|---|---|
GridFuture<Boolean> |
addEntry(long msgId,
GridCacheTxEntry<K,V> e) |
protected void |
addGroupTxMapping(Collection<K> keys)
Adds key mapping to transaction.
|
void |
addInvalidPartition(int part) |
void |
addLocalCandidates(K key,
Collection<GridCacheMvccCandidate<K>> cands) |
protected abstract GridFuture<Boolean> |
addReader(long msgId,
GridDhtCacheEntry<K,V> cached,
GridCacheTxEntry<K,V> entry,
long topVer)
Adds reader to cached entry.
|
protected abstract void |
clearPrepareFuture(GridDhtTxPrepareFuture<K,V> fut)
Removes previously created prepare future from atomic reference.
|
boolean |
finish(boolean commit)
Finishes transaction (either commit or rollback).
|
Map<K,Collection<GridCacheMvccCandidate<K>>> |
localCandidates() |
protected void |
mapExplicitLocks()
Map explicit locks.
|
protected abstract GridUuid |
nearFutureId() |
protected abstract GridUuid |
nearMiniId() |
protected abstract UUID |
nearNodeId() |
boolean |
needsCompletedVersions() |
void |
needsCompletedVersions(boolean needsCompletedVers) |
Collection<GridCacheVersion> |
pendingVersions() |
void |
pendingVersions(Collection<GridCacheVersion> pendingVers) |
boolean |
removeMapping(UUID nodeId) |
void |
rollback()
Rolls back this transaction.
|
protected abstract void |
sendFinishReply(boolean commit,
Throwable err) |
boolean |
syncCommit() |
boolean |
syncRollback() |
String |
toString() |
addEntry, allEntries, alternateVersions, batchStoreCommit, checkValid, commit, commitAfterLock, commitError, commitError, committedVersions, completedBase, completedVersions, empty, enlistWrite, entry, entryEx, entryEx, eventNodeId, getAllAsync, groupLockAsync, hasReadKey, hasWriteKey, init, isBatchUpdate, isSingleUpdate, isStarted, loadMissing, 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, updateExplicitVersion, userCommit, userPrepare, userRollback, writeEntries, writeMap, writeSetapplyTransformClosures, awaitCompletion, awaitSignal, awaitSignal, checkInternal, close, colocated, 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, nearXidVersion, nodeId, onePhaseCommit, onePhaseCommit, onTimeout, optimistic, optimisticLockEntries, otherNodeId, 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, 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, waitfuture, groupLockEntrycolocated, commitVersion, commitVersion, dht, done, endVersion, endVersion, enforceSerializable, finishFuture, groupLock, groupLockKey, implicitSingle, internal, invalidate, invalidPartitions, isSystemInvalidate, local, markFinalizing, markPreparing, near, nearXidVersion, onePhaseCommit, optimistic, optimisticLockEntries, otherNodeId, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, prepareAsync, readCommitted, recoveryWrites, remainingTime, repeatableRead, replicated, rollbackAsync, serializable, size, startVersion, state, subjectId, systemInvalidate, timedOut, topologyVersion, topologyVersion, transactionNodes, user, writeVersion, writeVersion, xidVersionclose, commitAsync, 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, timeoutIdprotected Map<UUID,GridDistributedTxMapping<K,V>> nearMap
protected Map<UUID,GridDistributedTxMapping<K,V>> dhtMap
protected GridDhtTxLocalAdapter()
Externalizable.protected GridDhtTxLocalAdapter(GridCacheVersion xidVer, boolean implicit, boolean implicitSingle, GridCacheContext<K,V> cctx, GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, boolean invalidate, boolean syncCommit, boolean syncRollback, boolean explicitLock, boolean swapEnabled, boolean storeEnabled, int txSize, @Nullable Object grpLockKey, boolean partLock, @Nullable UUID subjId)
xidVer - Transaction version.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.explicitLock - Explicit lock flag.swapEnabled - Swap enabled.storeEnabled - Store enabled flag.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 is locked.protected abstract UUID nearNodeId()
protected abstract GridUuid nearFutureId()
protected abstract GridUuid nearMiniId()
@Nullable protected abstract GridFuture<Boolean> addReader(long msgId, GridDhtCacheEntry<K,V> cached, GridCacheTxEntry<K,V> entry, long topVer)
msgId - Message ID.cached - Cached entry.entry - Transaction entry.True if reader was added as a result of this call.protected abstract void sendFinishReply(boolean commit,
@Nullable
Throwable err)
commit - Commit flag.err - Error, if any.public void needsCompletedVersions(boolean needsCompletedVers)
needsCompletedVers - True if needs completed versions.public boolean needsCompletedVersions()
needsCompletedVersions in interface GridCacheTxEx<K,V>needsCompletedVersions in class GridCacheTxAdapter<K,V>True if transaction needs completed versions for processing.public Collection<GridCacheVersion> pendingVersions()
public void pendingVersions(Collection<GridCacheVersion> pendingVers)
pendingVers - Versions for all pending locks that were in queue before tx locsk were released.public boolean syncCommit()
syncCommit in interface GridCacheTxEx<K,V>syncCommit in class GridCacheTxAdapter<K,V>True if transaction is configured with synchronous commit flag.public boolean syncRollback()
syncRollback in interface GridCacheTxEx<K,V>syncRollback in class GridCacheTxAdapter<K,V>True if transaction is configured with synchronous rollback flag.protected void mapExplicitLocks()
public boolean removeMapping(UUID nodeId)
nodeId - Node ID.True if mapping was removed.public void addInvalidPartition(int part)
addInvalidPartition in interface GridCacheTxEx<K,V>addInvalidPartition in class GridCacheTxAdapter<K,V>part - Invalid partition.@Nullable public GridFuture<Boolean> addEntry(long msgId, GridCacheTxEntry<K,V> e) throws GridException
msgId - Message ID.e - Entry to add.GridException - If failed.protected void addGroupTxMapping(Collection<K> keys)
addGroupTxMapping in class GridCacheTxLocalAdapter<K,V>keys - Keys to add.public boolean finish(boolean commit)
throws GridException
commit - True if commit, false if rollback.True if state has been changed.GridException - If finish failed.protected abstract void clearPrepareFuture(GridDhtTxPrepareFuture<K,V> fut)
fut - Expected future.public void rollback()
throws GridException
GridException - If rollback failed.public void addLocalCandidates(K key, Collection<GridCacheMvccCandidate<K>> cands)
key - Cache key.cands - Collection of lock candidates for that key.public Map<K,Collection<GridCacheMvccCandidate<K>>> localCandidates()
public String toString()
toString in class GridCacheTxLocalAdapter<K,V>Copyright © 2014. All rights reserved.