public class GridNearTxLocal<K,V> extends GridDhtTxLocalAdapter<K,V>
IgniteTxLocalAdapter.FinishClosure<T>, IgniteTxLocalAdapter.PLC1<T>, IgniteTxLocalAdapter.PLC2<T>, IgniteTxLocalAdapter.PMC<T>, IgniteTxLocalAdapter.PostLockClosure1<T>, IgniteTxLocalAdapter.PostLockClosure2<T>, IgniteTxLocalAdapter.PostMissClosure<T>IgniteInternalTx.FinalizationStatusdhtMap, nearMapactiveCacheIds, commitErr, doneFlag, implicitRes, minVer, needRetVal, readView, txMap, writeViewcctx, concurrency, endVer, grpLockKey, implicit, implicitSingle, internal, invalidate, isDone, isolation, loc, log, nodeId, onePhaseCommit, startTime, startVer, storeEnabled, subjId, syncCommit, syncRollback, taskName, taskNameHash, threadId, timeout, transform, txNodes, txSize, writeVer, xidVer| Constructor and Description |
|---|
GridNearTxLocal()
Empty constructor required for
Externalizable. |
GridNearTxLocal(GridCacheSharedContext<K,V> ctx,
boolean implicit,
boolean implicitSingle,
boolean sys,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
boolean invalidate,
boolean storeEnabled,
int txSize,
IgniteTxKey grpLockKey,
boolean partLock,
UUID subjId,
int taskNameHash) |
| Modifier and Type | Method and Description |
|---|---|
protected IgniteCacheExpiryPolicy |
accessPolicy(GridCacheContext ctx,
IgniteTxKey<K> key,
javax.cache.expiry.ExpiryPolicy expiryPlc) |
protected void |
addGroupTxMapping(Collection<IgniteTxKey<K>> keys)
Adds key mapping to transaction.
|
void |
addKeyMapping(IgniteTxKey<K> key,
ClusterNode node)
Adds key mapping to dht mapping.
|
protected IgniteInternalFuture<Boolean> |
addReader(long msgId,
GridDhtCacheEntry<K,V> cached,
IgniteTxEntry<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.
|
void |
close()
Ends the transaction.
|
boolean |
colocated() |
boolean |
colocatedLocallyMapped() |
void |
colocatedLocallyMapped(boolean colocatedLocallyMapped) |
IgniteInternalFuture<IgniteInternalTx> |
commitAsync()
Asynchronously commits this transaction by initiating
two-phase-commit process. |
IgniteInternalFuture<IgniteInternalTx> |
commitAsyncLocal()
Commits local part of colocated transaction.
|
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. |
protected GridCacheEntryEx<K,V> |
entryEx(GridCacheContext<K,V> cacheCtx,
IgniteTxKey<K> key)
Gets cache entry for given key.
|
protected GridCacheEntryEx<K,V> |
entryEx(GridCacheContext<K,V> cacheCtx,
IgniteTxKey<K> key,
long topVer)
Gets cache entry for given key and topology version.
|
boolean |
finish(boolean commit)
Finishes transaction (either commit or rollback).
|
IgniteInternalFuture<Boolean> |
loadMissing(GridCacheContext<K,V> cacheCtx,
boolean readThrough,
boolean async,
Collection<? extends K> keys,
boolean deserializePortable,
boolean skipVals,
IgniteBiInClosure<K,V> c) |
IgniteInternalFuture<GridCacheReturn<V>> |
lockAllAsync(GridCacheContext<K,V> cacheCtx,
Collection<? extends K> keys,
boolean implicit,
boolean read,
long accessTtl) |
boolean |
markExplicit(UUID nodeId) |
boolean |
near() |
protected IgniteUuid |
nearFutureId() |
boolean |
nearLocallyMapped() |
void |
nearLocallyMapped(boolean nearLocallyMapped) |
protected IgniteUuid |
nearMiniId() |
protected UUID |
nearNodeId() |
GridCacheVersion |
nearXidVersion() |
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.
|
Collection<IgniteTxEntry<K,V>> |
optimisticLockEntries()
Gets a list of entries that needs to be locked on the next step of prepare stage of
optimistic transaction.
|
void |
optimisticLockEntries(Collection<IgniteTxEntry<K,V>> optimisticLockEntries) |
boolean |
ownsLock(GridCacheEntryEx<K,V> entry) |
boolean |
ownsLockUnsafe(GridCacheEntryEx<K,V> entry) |
IgniteInternalFuture<IgniteInternalTx<K,V>> |
prepareAsync()
Prepare stage.
|
IgniteInternalFuture<IgniteInternalTx<K,V>> |
prepareAsyncLocal(Collection<IgniteTxEntry<K,V>> reads,
Collection<IgniteTxEntry<K,V>> writes,
Map<UUID,Collection<UUID>> txNodes,
boolean last,
Collection<UUID> lastBackups,
IgniteInClosure<GridNearTxPrepareResponse<K,V>> completeCb)
Prepares next batch of entries in dht transaction.
|
boolean |
removeMapping(UUID nodeId) |
IgniteInternalFuture<IgniteInternalTx> |
rollbackAsync()
Asynchronously rollback this transaction.
|
IgniteInternalFuture<IgniteInternalTx> |
rollbackAsyncLocal()
Rolls back local part of colocated transaction.
|
protected void |
sendFinishReply(boolean commit,
Throwable err) |
boolean |
syncCommit() |
boolean |
syncRollback() |
GridDiscoveryTopologySnapshot |
topologySnapshot() |
boolean |
topologySnapshot(GridDiscoveryTopologySnapshot topSnapshot)
Sets topology snapshot on which this tx was started.
|
String |
toString() |
protected void |
updateExplicitVersion(IgniteTxEntry<K,V> txEntry,
GridCacheEntryEx<K,V> entry)
Updates explicit version for tx entry based on current entry lock owner.
|
addDhtMapping, addEntry, addInvalidPartition, addNearMapping, mapExplicitLocks, needsCompletedVersions, needsCompletedVersions, pendingVersions, pendingVersions, rollbackactiveCacheIds, addActiveCache, addEntry, allEntries, alternateVersions, batchStoreCommit, checkValid, commit, commitAfterLock, commitError, commitError, committedVersions, completedBase, completedVersions, empty, enlistWrite, entry, entryExpireTime, entryTtl, entryTtl, eventNodeId, getAllAsync, groupLockAsync, hasWriteKey, implicitSingleResult, implicitSingleResult, init, invokeAsync, isStarted, masterNodeIds, minVersion, needReturnValue, needReturnValue, originatingNodeId, partitionLock, peek, postLockWrite, prepare, putAllAsync, putAllDrAsync, readEntries, readMap, readSet, removeAllAsync, removeAllDrAsync, removed, rolledbackVersions, seal, sendTransformedValues, tmCommit, userCommit, userPrepare, userRollback, writeEntries, writeMap, writeSetapplyTransformClosures, awaitCompletion, awaitSignal, checkInternal, commitVersion, commitVersion, concurrency, conflictResolve, dht, done, endTime, endVersion, endVersion, equals, evictNearEntry, finalizationStatus, finishFuture, groupLock, groupLockEntry, groupLockKey, hashCode, hasTransforms, implicit, implicitSingle, initCommitVersion, internal, invalidate, invalidPartitions, ioPolicy, isInvalidate, isNearLocallyMapped, isolation, isRollbackOnly, isSystemInvalidate, local, lock, lockTimeout, log, markFinalizing, markPreparing, nodeId, onePhaseCommit, onePhaseCommit, onTimeout, optimistic, otherNodeId, ownedVersion, pessimistic, proxy, readCommitted, readExternal, readResolve, remainingTime, repeatableRead, replicated, resolveTaskName, serializable, setRollbackOnly, signalAll, size, startTime, startVersion, state, state, store, storeEnabled, storeEnabled, storeUsed, subjectId, syncCommit, syncRollback, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, timeoutId, topologyVersion, topologyVersion, transactionNodes, transactionNodes, uncommit, 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, waitgroupLockEntryaddMeta, commitVersion, commitVersion, concurrency, dht, done, endVersion, endVersion, finishFuture, groupLock, groupLockKey, hasTransforms, implicit, implicitSingle, internal, invalidate, invalidPartitions, ioPolicy, isInvalidate, isolation, isRollbackOnly, isSystemInvalidate, local, markFinalizing, markPreparing, meta, nodeId, onePhaseCommit, optimistic, otherNodeId, ownedVersion, pessimistic, proxy, readCommitted, remainingTime, removeMeta, repeatableRead, replicated, serializable, setRollbackOnly, size, startTime, startVersion, state, state, storeEnabled, storeUsed, subjectId, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, topologyVersion, topologyVersion, transactionNodes, user, writeVersion, writeVersion, xid, xidVersionendTime, onTimeout, timeoutIdpublic GridNearTxLocal()
Externalizable.public GridNearTxLocal(GridCacheSharedContext<K,V> ctx, boolean implicit, boolean implicitSingle, boolean sys, TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, boolean invalidate, boolean storeEnabled, int txSize, @Nullable IgniteTxKey grpLockKey, boolean partLock, @Nullable UUID subjId, int taskNameHash)
ctx - Cache registry.implicit - Implicit flag.implicitSingle - Implicit with one key flag.sys - System flag.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.invalidate - Invalidate flag.storeEnabled - Store enabled flag.txSize - Transaction size.grpLockKey - Group lock key if this is a group lock transaction.partLock - True if this is a group-lock transaction and the whole partition should be locked.subjId - Subject ID.taskNameHash - Task name hash code.public boolean near()
near in interface IgniteInternalTx<K,V>near in class IgniteTxAdapter<K,V>True if near transaction.public boolean colocated()
colocated in interface IgniteInternalTx<K,V>colocated in class IgniteTxAdapter<K,V>True if dht colocated transaction.@Nullable public GridCacheVersion nearXidVersion()
nearXidVersion in interface IgniteInternalTx<K,V>nearXidVersion in class IgniteTxAdapter<K,V>public 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.enforceSerializable in interface IgniteInternalTx<K,V>enforceSerializable in class IgniteTxAdapter<K,V>protected UUID nearNodeId()
nearNodeId in class GridDhtTxLocalAdapter<K,V>protected IgniteUuid nearFutureId()
nearFutureId in class GridDhtTxLocalAdapter<K,V>protected IgniteUuid nearMiniId()
nearMiniId in class GridDhtTxLocalAdapter<K,V>protected IgniteInternalFuture<Boolean> addReader(long msgId, GridDhtCacheEntry<K,V> cached, IgniteTxEntry<K,V> entry, long topVer)
addReader in class GridDhtTxLocalAdapter<K,V>msgId - Message ID.cached - Cached entry.entry - Transaction entry.topVer - Topology version.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 boolean syncCommit()
syncCommit in interface IgniteInternalTx<K,V>syncCommit in class IgniteTxAdapter<K,V>True if transaction is configured with synchronous commit flag.public boolean syncRollback()
syncRollback in interface IgniteInternalTx<K,V>syncRollback in class IgniteTxAdapter<K,V>True if transaction is configured with synchronous rollback flag.public boolean nearLocallyMapped()
True if transaction contains at least one near cache key mapped to the local node.public void nearLocallyMapped(boolean nearLocallyMapped)
nearLocallyMapped - True if transaction contains near key mapped to the local node.public boolean colocatedLocallyMapped()
True if transaction contains colocated key mapped to the local node.public void colocatedLocallyMapped(boolean colocatedLocallyMapped)
colocatedLocallyMapped - True if transaction contains colocated key mapped to the local node.public boolean ownsLockUnsafe(GridCacheEntryEx<K,V> entry)
ownsLockUnsafe in interface IgniteInternalTx<K,V>ownsLockUnsafe in class IgniteTxAdapter<K,V>entry - Entry to check.True if lock is owned.public boolean ownsLock(GridCacheEntryEx<K,V> entry) throws GridCacheEntryRemovedException
ownsLock in interface IgniteInternalTx<K,V>ownsLock in class IgniteTxAdapter<K,V>entry - Entry to check.True if lock is owned.GridCacheEntryRemovedException - If entry has been removed.public Collection<IgniteTxEntry<K,V>> optimisticLockEntries()
optimisticLockEntries in interface IgniteInternalTx<K,V>optimisticLockEntries in class IgniteTxAdapter<K,V>public void optimisticLockEntries(Collection<IgniteTxEntry<K,V>> optimisticLockEntries)
optimisticLockEntries - Optimistic lock entries.public IgniteInternalFuture<Boolean> loadMissing(GridCacheContext<K,V> cacheCtx, boolean readThrough, boolean async, Collection<? extends K> keys, boolean deserializePortable, boolean skipVals, IgniteBiInClosure<K,V> c)
loadMissing in interface IgniteTxLocalEx<K,V>loadMissing in class IgniteTxLocalAdapter<K,V>cacheCtx - Cache context.readThrough - Read through flag.async - if True, then loading will happen in a separate thread.keys - Keys.deserializePortable - Deserialize portable flag.skipVals - Skip values flag.c - Closure.True value if loading took place.protected void updateExplicitVersion(IgniteTxEntry<K,V> txEntry, GridCacheEntryEx<K,V> entry) throws GridCacheEntryRemovedException
updateExplicitVersion in class IgniteTxLocalAdapter<K,V>txEntry - Tx entry to update.entry - Entry.GridCacheEntryRemovedException - If entry was concurrently removed.public boolean removeMapping(UUID nodeId)
removeMapping in class GridDhtTxLocalAdapter<K,V>nodeId - Undo mapping.True if mapping was removed.protected void addGroupTxMapping(Collection<IgniteTxKey<K>> keys)
addGroupTxMapping in class GridDhtTxLocalAdapter<K,V>keys - Keys to add.public void addKeyMapping(IgniteTxKey<K> key, ClusterNode node)
key - Key to add.node - Node this key mapped to.public boolean markExplicit(UUID nodeId)
nodeId - Node ID to mark with explicit lock.True if mapping was found.public boolean onOwnerChanged(GridCacheEntryEx<K,V> entry, GridCacheMvccCandidate<K> owner)
onOwnerChanged in interface IgniteInternalTx<K,V>onOwnerChanged in class IgniteTxLocalAdapter<K,V>entry - Cache entry.owner - Lock candidate that won ownership of the lock.True if transaction cared about notification.public GridDiscoveryTopologySnapshot topologySnapshot()
public boolean topologySnapshot(GridDiscoveryTopologySnapshot topSnapshot)
topSnapshot - Topology snapshot.True if topology snapshot was set by this call.public boolean finish(boolean commit)
throws IgniteCheckedException
finish in interface IgniteTxLocalEx<K,V>finish in class GridDhtTxLocalAdapter<K,V>commit - True if commit, false if rollback.True if state has been changed.IgniteCheckedException - If finish failed.public IgniteInternalFuture<IgniteInternalTx<K,V>> prepareAsync()
public IgniteInternalFuture<IgniteInternalTx> commitAsync()
two-phase-commit process.public IgniteInternalFuture<IgniteInternalTx> rollbackAsync()
public IgniteInternalFuture<IgniteInternalTx<K,V>> prepareAsyncLocal(@Nullable Collection<IgniteTxEntry<K,V>> reads, @Nullable Collection<IgniteTxEntry<K,V>> writes, Map<UUID,Collection<UUID>> txNodes, boolean last, Collection<UUID> lastBackups, IgniteInClosure<GridNearTxPrepareResponse<K,V>> completeCb)
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.public IgniteInternalFuture<IgniteInternalTx> commitAsyncLocal()
public IgniteInternalFuture<IgniteInternalTx> rollbackAsyncLocal()
public IgniteInternalFuture<GridCacheReturn<V>> lockAllAsync(GridCacheContext<K,V> cacheCtx, Collection<? extends K> keys, boolean implicit, boolean read, long accessTtl)
protected GridCacheEntryEx<K,V> entryEx(GridCacheContext<K,V> cacheCtx, IgniteTxKey<K> key)
entryEx in class IgniteTxLocalAdapter<K,V>cacheCtx - Cache context.key - Key.protected GridCacheEntryEx<K,V> entryEx(GridCacheContext<K,V> cacheCtx, IgniteTxKey<K> key, long topVer)
entryEx in class IgniteTxLocalAdapter<K,V>cacheCtx - Cache context.key - Key.topVer - Topology version.protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext ctx, IgniteTxKey<K> key, @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc)
accessPolicy in class IgniteTxLocalAdapter<K,V>ctx - Cache context.key - Key.expiryPlc - Expiry policy.public void close()
throws IgniteCheckedException
close in interface AutoCloseableclose in interface IgniteInternalTx<K,V>close in class IgniteTxAdapter<K,V>IgniteCheckedException - If transaction could not be gracefully ended.public String toString()
toString in class GridDhtTxLocalAdapter<K,V>
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC1 Release Date : February 17 2015