public class GridNearTxLocal extends GridDhtTxLocalAdapter
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 ctx,
boolean implicit,
boolean implicitSingle,
boolean sys,
GridIoPolicy plc,
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 key,
javax.cache.expiry.ExpiryPolicy expiryPlc) |
protected void |
addGroupTxMapping(Collection<IgniteTxKey> keys)
Adds key mapping to transaction.
|
void |
addKeyMapping(IgniteTxKey key,
ClusterNode node)
Adds key mapping to dht mapping.
|
protected IgniteInternalFuture<Boolean> |
addReader(long msgId,
GridDhtCacheEntry cached,
IgniteTxEntry entry,
long topVer)
Adds reader to cached entry.
|
protected void |
clearPrepareFuture(GridDhtTxPrepareFuture 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 |
entryEx(GridCacheContext cacheCtx,
IgniteTxKey key)
Gets cache entry for given key.
|
protected GridCacheEntryEx |
entryEx(GridCacheContext cacheCtx,
IgniteTxKey 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 cacheCtx,
boolean readThrough,
boolean async,
Collection<KeyCacheObject> keys,
boolean deserializePortable,
boolean skipVals,
IgniteBiInClosure<KeyCacheObject,Object> c) |
<K> IgniteInternalFuture<GridCacheReturn> |
lockAllAsync(GridCacheContext 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 entry,
GridCacheMvccCandidate owner)
Callback invoked whenever there is a lock that has been acquired
by this transaction for any of the participating entries.
|
Collection<IgniteTxEntry> |
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> optimisticLockEntries) |
boolean |
ownsLock(GridCacheEntryEx entry) |
boolean |
ownsLockUnsafe(GridCacheEntryEx entry) |
IgniteInternalFuture<IgniteInternalTx> |
prepareAsync()
Prepare stage.
|
IgniteInternalFuture<IgniteInternalTx> |
prepareAsyncLocal(Collection<IgniteTxEntry> reads,
Collection<IgniteTxEntry> writes,
Map<UUID,Collection<UUID>> txNodes,
boolean last,
Collection<UUID> lastBackups,
IgniteInClosure<GridNearTxPrepareResponse> 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 txEntry,
GridCacheEntryEx 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, eventNodeId, getAllAsync, groupLockAsync, hasWriteKey, implicitSingleResult, implicitSingleResult, init, initResult, 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, localResult, 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, 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, localResult, 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 ctx, boolean implicit, boolean implicitSingle, boolean sys, GridIoPolicy plc, 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 IgniteInternalTxnear in class IgniteTxAdapterTrue if near transaction.public boolean colocated()
colocated in interface IgniteInternalTxcolocated in class IgniteTxAdapterTrue if dht colocated transaction.@Nullable public GridCacheVersion nearXidVersion()
nearXidVersion in interface IgniteInternalTxnearXidVersion in class IgniteTxAdapterpublic 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 IgniteInternalTxenforceSerializable in class IgniteTxAdapterprotected UUID nearNodeId()
nearNodeId in class GridDhtTxLocalAdapterprotected IgniteUuid nearFutureId()
nearFutureId in class GridDhtTxLocalAdapterprotected IgniteUuid nearMiniId()
nearMiniId in class GridDhtTxLocalAdapterprotected IgniteInternalFuture<Boolean> addReader(long msgId, GridDhtCacheEntry cached, IgniteTxEntry entry, long topVer)
addReader in class GridDhtTxLocalAdaptermsgId - 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 GridDhtTxLocalAdaptercommit - Commit flag.err - Error, if any.protected void clearPrepareFuture(GridDhtTxPrepareFuture fut)
clearPrepareFuture in class GridDhtTxLocalAdapterfut - Expected future.public boolean syncCommit()
syncCommit in interface IgniteInternalTxsyncCommit in class IgniteTxAdapterTrue if transaction is configured with synchronous commit flag.public boolean syncRollback()
syncRollback in interface IgniteInternalTxsyncRollback in class IgniteTxAdapterTrue 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 entry)
ownsLockUnsafe in interface IgniteInternalTxownsLockUnsafe in class IgniteTxAdapterentry - Entry to check.True if lock is owned.public boolean ownsLock(GridCacheEntryEx entry) throws GridCacheEntryRemovedException
ownsLock in interface IgniteInternalTxownsLock in class IgniteTxAdapterentry - Entry to check.True if lock is owned.GridCacheEntryRemovedException - If entry has been removed.public Collection<IgniteTxEntry> optimisticLockEntries()
optimisticLockEntries in interface IgniteInternalTxoptimisticLockEntries in class IgniteTxAdapterpublic void optimisticLockEntries(Collection<IgniteTxEntry> optimisticLockEntries)
optimisticLockEntries - Optimistic lock entries.public IgniteInternalFuture<Boolean> loadMissing(GridCacheContext cacheCtx, boolean readThrough, boolean async, Collection<KeyCacheObject> keys, boolean deserializePortable, boolean skipVals, IgniteBiInClosure<KeyCacheObject,Object> c)
loadMissing in interface IgniteTxLocalExloadMissing in class IgniteTxLocalAdaptercacheCtx - 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 txEntry, GridCacheEntryEx entry) throws GridCacheEntryRemovedException
updateExplicitVersion in class IgniteTxLocalAdaptertxEntry - Tx entry to update.entry - Entry.GridCacheEntryRemovedException - If entry was concurrently removed.public boolean removeMapping(UUID nodeId)
removeMapping in class GridDhtTxLocalAdapternodeId - Undo mapping.True if mapping was removed.protected void addGroupTxMapping(Collection<IgniteTxKey> keys)
addGroupTxMapping in class GridDhtTxLocalAdapterkeys - Keys to add.public void addKeyMapping(IgniteTxKey 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 entry, GridCacheMvccCandidate owner)
onOwnerChanged in interface IgniteInternalTxonOwnerChanged in class IgniteTxLocalAdapterentry - 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 IgniteTxLocalExfinish in class GridDhtTxLocalAdaptercommit - True if commit, false if rollback.True if state has been changed.IgniteCheckedException - If finish failed.public IgniteInternalFuture<IgniteInternalTx> prepareAsync()
public IgniteInternalFuture<IgniteInternalTx> commitAsync()
two-phase-commit process.public IgniteInternalFuture<IgniteInternalTx> rollbackAsync()
public IgniteInternalFuture<IgniteInternalTx> prepareAsyncLocal(@Nullable Collection<IgniteTxEntry> reads, @Nullable Collection<IgniteTxEntry> writes, Map<UUID,Collection<UUID>> txNodes, boolean last, Collection<UUID> lastBackups, IgniteInClosure<GridNearTxPrepareResponse> 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 <K> IgniteInternalFuture<GridCacheReturn> lockAllAsync(GridCacheContext cacheCtx, Collection<? extends K> keys, boolean implicit, boolean read, long accessTtl)
protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey key)
entryEx in class IgniteTxLocalAdaptercacheCtx - Cache context.key - Key.protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey key, long topVer)
entryEx in class IgniteTxLocalAdaptercacheCtx - Cache context.key - Key.topVer - Topology version.protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext ctx, IgniteTxKey key, @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc)
accessPolicy in class IgniteTxLocalAdapterctx - Cache context.key - Key.expiryPlc - Expiry policy.public void close()
throws IgniteCheckedException
close in interface AutoCloseableclose in interface IgniteInternalTxclose in class IgniteTxAdapterIgniteCheckedException - If transaction could not be gracefully ended.public String toString()
toString in class GridDhtTxLocalAdapter
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015