public abstract class GridCacheTxLocalAdapter<K,V> extends GridCacheTxAdapter<K,V> implements GridCacheTxLocalEx<K,V>
| Modifier and Type | Class and Description |
|---|---|
protected class |
GridCacheTxLocalAdapter.FinishClosure<T>
Post-lock closure.
|
protected class |
GridCacheTxLocalAdapter.PLC1<T>
Post-lock closure alias.
|
protected class |
GridCacheTxLocalAdapter.PLC2<T>
Post-lock closure alias.
|
protected class |
GridCacheTxLocalAdapter.PMC<T>
Post-lock closure alias.
|
protected class |
GridCacheTxLocalAdapter.PostLockClosure1<T>
Post-lock closure.
|
protected class |
GridCacheTxLocalAdapter.PostLockClosure2<T>
Post-lock closure.
|
protected class |
GridCacheTxLocalAdapter.PostMissClosure<T>
Post-lock closure.
|
GridCacheTxEx.FinalizationStatus| Modifier and Type | Field and Description |
|---|---|
protected AtomicReference<Throwable> |
commitErr
Commit error.
|
protected AtomicBoolean |
doneFlag
Flag indicating with TM commit happened.
|
protected GridCacheVersion |
minVer
Minimal version encountered (either explicit lock or XID of this transaction).
|
protected GridCacheTxMap<K,V> |
readView
Read view on transaction map.
|
protected Map<K,GridCacheTxEntry<K,V>> |
txMap
Per-transaction read map.
|
protected GridCacheTxMap<K,V> |
writeView
Write view on transaction map.
|
cctx, 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 |
GridCacheTxLocalAdapter()
Empty constructor required for
Externalizable. |
protected |
GridCacheTxLocalAdapter(GridCacheContext<K,V> cctx,
GridCacheVersion xidVer,
boolean implicit,
boolean implicitSingle,
GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
boolean swapEnabled,
boolean storeEnabled,
int txSize,
Object grpLockKey,
boolean partLock,
UUID subjId) |
| Modifier and Type | Method and Description |
|---|---|
protected GridCacheTxEntry<K,V> |
addEntry(GridCacheOperation op,
V val,
GridClosure<V,V> transformClos,
GridCacheEntryEx<K,V> entry,
long ttl,
GridPredicate<GridCacheEntry<K,V>>[] filter,
boolean filtersSet,
long drTtl,
long drExpireTime,
GridCacheVersion drVer) |
protected void |
addGroupTxMapping(Collection<K> keys)
Adds key mapping to transaction.
|
Collection<GridCacheTxEntry<K,V>> |
allEntries() |
Collection<GridCacheVersion> |
alternateVersions() |
protected void |
batchStoreCommit(Iterable<GridCacheTxEntry<K,V>> writeEntries)
Performs batch database operations.
|
protected void |
checkValid(GridPredicate<GridCacheEntry<K,V>>[] filter)
Checks transaction expiration.
|
void |
commit()
Commits this transaction by initiating
two-phase-commit process. |
protected boolean |
commitAfterLock() |
Throwable |
commitError() |
void |
commitError(Throwable e) |
Collection<GridCacheVersion> |
committedVersions() |
GridCacheVersion |
completedBase() |
void |
completedVersions(GridCacheVersion completedBase,
Collection<GridCacheVersion> committedVers,
Collection<GridCacheVersion> rolledbackVers) |
boolean |
empty() |
protected GridFuture<Set<K>> |
enlistWrite(Collection<? extends K> keys,
GridCacheEntryEx<K,V> cached,
long ttl,
boolean implicit,
Map<? extends K,? extends V> lookup,
Map<? extends K,? extends GridClosure<V,V>> transformMap,
boolean retval,
boolean lockOnly,
GridPredicate<GridCacheEntry<K,V>>[] filter,
GridCacheReturn<V> ret,
Collection<K> enlisted,
Map<? extends K,GridCacheDrInfo<V>> drPutMap,
Map<? extends K,GridCacheVersion> drRmvMap)
Internal routine for putAll(..)
|
GridCacheTxEntry<K,V> |
entry(K key) |
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.
|
UUID |
eventNodeId() |
GridFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys,
GridCacheEntryEx<K,V> cached,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridFuture<?> |
groupLockAsync(Collection<K> keys)
Performs keys locking for affinity-based group lock transactions.
|
boolean |
hasReadKey(K key) |
boolean |
hasWriteKey(K key) |
boolean |
init()
Initializes read map.
|
protected boolean |
isBatchUpdate() |
protected boolean |
isSingleUpdate() |
boolean |
isStarted() |
GridFuture<Boolean> |
loadMissing(boolean async,
Collection<? extends K> keys,
GridBiInClosure<K,V> c) |
Collection<UUID> |
masterNodeIds() |
GridCacheVersion |
minVersion()
Gets minimum version present in transaction.
|
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.
|
UUID |
originatingNodeId()
Gets node ID which directly started this transaction.
|
boolean |
partitionLock() |
GridTuple<V> |
peek(boolean failFast,
K key,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
protected Set<K> |
postLockWrite(Iterable<? extends K> keys,
Set<K> failed,
Map<K,V> transformed,
Map<? extends K,? extends GridClosure<V,V>> transformMap,
GridCacheReturn<V> ret,
boolean rmv,
boolean retval,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Post lock processing for put or remove.
|
void |
prepare()
Prepare state.
|
V |
put(K key,
V val,
GridCacheEntryEx<K,V> cached,
long ttl,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridCacheReturn<V> |
putAll(Map<? extends K,? extends V> map,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridFuture<GridCacheReturn<V>> |
putAllAsync(Map<? extends K,? extends V> map,
boolean retval,
GridCacheEntryEx<K,V> cached,
long ttl,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
void |
putAllDr(Map<? extends K,GridCacheDrInfo<V>> drMap) |
GridFuture<?> |
putAllDrAsync(Map<? extends K,GridCacheDrInfo<V>> drMap) |
GridFuture<V> |
putAsync(K key,
V val,
GridCacheEntryEx<K,V> cached,
long ttl,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridFuture<V> |
putAsync(K key,
V val,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
boolean |
putx(K key,
V val,
GridCacheEntryEx<K,V> cached,
long ttl,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
boolean |
putx(K key,
V val,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridFuture<Boolean> |
putxAsync(K key,
V val,
GridCacheEntryEx<K,V> cached,
long ttl,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridFuture<Boolean> |
putxAsync(K key,
V val,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridFuture<GridCacheReturn<V>> |
putxAsync0(K key,
V val,
GridCacheEntryEx<K,V> cached,
long ttl,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
Collection<GridCacheTxEntry<K,V>> |
readEntries() |
Map<K,GridCacheTxEntry<K,V>> |
readMap() |
Set<K> |
readSet() |
V |
remove(K key,
GridCacheEntryEx<K,V> cached,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridCacheReturn<V> |
removeAll(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridFuture<GridCacheReturn<V>> |
removeAllAsync(Collection<? extends K> keys,
GridCacheEntryEx<K,V> cached,
boolean implicit,
boolean retval,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
void |
removeAllDr(Map<? extends K,GridCacheVersion> drMap) |
GridFuture<?> |
removeAllDrAsync(Map<? extends K,GridCacheVersion> drMap) |
GridFuture<V> |
removeAsync(K key,
GridCacheEntryEx<K,V> cached,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Asynchronous remove.
|
boolean |
removed(K key)
Checks whether given key has been removed within transaction.
|
boolean |
removex(K key,
GridCacheEntryEx<K,V> cached,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridFuture<Boolean> |
removexAsync(K key,
GridCacheEntryEx<K,V> cached,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Asynchronous remove.
|
GridFuture<GridCacheReturn<V>> |
removexAsync0(K key,
GridCacheEntryEx<K,V> cached,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Asynchronous remove.
|
Collection<GridCacheVersion> |
rolledbackVersions() |
void |
seal()
Seals transaction for updates.
|
void |
sendTransformedValues(boolean snd) |
void |
tmCommit()
Commits transaction to transaction manager.
|
String |
toString() |
boolean |
transform(K key,
GridClosure<V,V> transformer) |
void |
transformAll(Map<? extends K,? extends GridClosure<V,V>> map) |
GridFuture<?> |
transformAllAsync(Map<? extends K,? extends GridClosure<V,V>> map) |
GridFuture<Boolean> |
transformAsync(K key,
GridClosure<V,V> transformer,
GridCacheEntryEx<K,V> cached,
long ttl) |
<R> R |
transformCompute(K key,
GridClosure<V,GridBiTuple<V,R>> transformer) |
protected void |
updateExplicitVersion(GridCacheTxEntry<K,V> txEntry,
GridCacheEntryEx<K,V> entry)
Updates explicit version for tx entry based on current entry lock owner.
|
void |
userCommit() |
protected void |
userPrepare() |
void |
userRollback() |
Collection<GridCacheTxEntry<K,V>> |
writeEntries() |
Map<K,GridCacheTxEntry<K,V>> |
writeMap() |
Set<K> |
writeSet() |
addInvalidPartition, applyTransformClosures, 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, needsCompletedVersions, 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, syncCommit, syncRollback, 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, waitfinish, future, groupLockEntryaddInvalidPartition, addLocalCandidates, colocated, commitVersion, commitVersion, dht, done, endVersion, endVersion, enforceSerializable, finishFuture, groupLock, groupLockKey, implicitSingle, internal, invalidate, invalidPartitions, isSystemInvalidate, local, localCandidates, markFinalizing, markPreparing, near, nearXidVersion, needsCompletedVersions, onePhaseCommit, optimistic, optimisticLockEntries, otherNodeId, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, prepareAsync, readCommitted, recoveryWrites, remainingTime, repeatableRead, replicated, rollbackAsync, serializable, size, startVersion, state, subjectId, syncCommit, syncRollback, systemInvalidate, timedOut, topologyVersion, topologyVersion, transactionNodes, user, writeVersion, writeVersion, xidVersionclose, commitAsync, concurrency, implicit, isInvalidate, isolation, isRollbackOnly, nodeId, rollback, setRollbackOnly, startTime, state, threadId, timeout, timeout, xidaddMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMetaendTime, onTimeout, timeoutId@GridToStringExclude protected Map<K,GridCacheTxEntry<K,V>> txMap
@GridToStringExclude protected GridCacheTxMap<K,V> readView
@GridToStringExclude protected GridCacheTxMap<K,V> writeView
protected GridCacheVersion minVer
protected AtomicBoolean doneFlag
protected AtomicReference<Throwable> commitErr
protected GridCacheTxLocalAdapter()
Externalizable.protected GridCacheTxLocalAdapter(GridCacheContext<K,V> cctx, GridCacheVersion xidVer, boolean implicit, boolean implicitSingle, GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, boolean invalidate, boolean swapEnabled, boolean storeEnabled, int txSize, @Nullable Object grpLockKey, boolean partLock, @Nullable UUID subjId)
cctx - Cache registry.xidVer - Transaction ID.implicit - True if transaction was implicitly started by the system,
false if it was started explicitly by user.implicitSingle - True if transaction is implicit with only one key.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.invalidate - Invalidation policy.swapEnabled - Whether to use swap storage.storeEnabled - Whether to use read/write through.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 lock is acquired for whole partition.public UUID eventNodeId()
eventNodeId in interface GridCacheTxEx<K,V>public UUID originatingNodeId()
originatingNodeId in interface GridCacheTxEx<K,V>public boolean empty()
empty in interface GridCacheTxEx<K,V>True if transaction is empty.public Collection<UUID> masterNodeIds()
masterNodeIds in interface GridCacheTxEx<K,V>public boolean partitionLock()
partitionLock in interface GridCacheTxLocalEx<K,V>True if keys from the same partition are allowed to be enlisted in group-lock transaction.public Throwable commitError()
commitError in interface GridCacheTxLocalEx<K,V>public void commitError(Throwable e)
commitError in interface GridCacheTxLocalEx<K,V>e - Commit error.public boolean onOwnerChanged(GridCacheEntryEx<K,V> entry, GridCacheMvccCandidate<K> owner)
onOwnerChanged in interface GridCacheTxEx<K,V>entry - Cache entry.owner - Lock candidate that won ownership of the lock.True if transaction cared about notification.public boolean isStarted()
isStarted in class GridCacheTxAdapter<K,V>True if transaction has at least one key enlisted.public boolean hasReadKey(K key)
hasReadKey in interface GridCacheTxEx<K,V>key - Key to check.True if key is present.public boolean hasWriteKey(K key)
hasWriteKey in interface GridCacheTxEx<K,V>key - Key to check.True if key is present.public Set<K> readSet()
readSet in interface GridCacheTxEx<K,V>public Set<K> writeSet()
writeSet in interface GridCacheTxEx<K,V>public boolean removed(K key)
removed in interface GridCacheTxEx<K,V>key - Key to check.True if key has been removed.public Map<K,GridCacheTxEntry<K,V>> readMap()
readMap in interface GridCacheTxEx<K,V>public Map<K,GridCacheTxEntry<K,V>> writeMap()
writeMap in interface GridCacheTxEx<K,V>public Collection<GridCacheTxEntry<K,V>> allEntries()
allEntries in interface GridCacheTxEx<K,V>public Collection<GridCacheTxEntry<K,V>> readEntries()
readEntries in interface GridCacheTxEx<K,V>public Collection<GridCacheTxEntry<K,V>> writeEntries()
writeEntries in interface GridCacheTxEx<K,V>@Nullable public GridCacheTxEntry<K,V> entry(K key)
entry in interface GridCacheTxEx<K,V>key - Key for the entry.public void seal()
seal in interface GridCacheTxEx<K,V>public void sendTransformedValues(boolean snd)
snd - True if values in tx entries should be replaced with transformed values and sent
to remote nodes.protected boolean commitAfterLock()
True if should be committed after lock is acquired.@Nullable public GridTuple<V> peek(boolean failFast, K key, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridCacheFilterFailedException
peek in interface GridCacheTxEx<K,V>failFast - Fail-fast flag.key - Key to look up.filter - Filter to check.GridCacheFilterFailedException - If filter failed and failFast is true.public GridFuture<Boolean> loadMissing(boolean async, Collection<? extends K> keys, GridBiInClosure<K,V> c)
loadMissing in interface GridCacheTxLocalEx<K,V>async - if True, then loading will happen in a separate thread.keys - Keys.c - Closure.True value if loading took place.public GridCacheVersion minVersion()
minVersion in interface GridCacheTxLocalEx<K,V>protected void userPrepare()
throws GridException
GridException - If prepare step failed.public void commit()
throws GridException
two-phase-commit process.commit in interface GridCacheTxGridException - If commit failed.public void prepare()
throws GridException
prepare in interface GridCacheTxEx<K,V>GridException - If failed.protected GridCacheEntryEx<K,V> entryEx(K key)
key - Key.protected GridCacheEntryEx<K,V> entryEx(K key, long topVer)
key - Key.topVer - Topology version.protected void batchStoreCommit(Iterable<GridCacheTxEntry<K,V>> writeEntries) throws GridException
userCommit(). This way if there is a DB failure,
cache transaction can still be rolled back.writeEntries - Transaction write set.GridException - If batch update failed.public void userCommit()
throws GridException
userCommit in interface GridCacheTxLocalEx<K,V>GridException - If commit failed.public void tmCommit()
public void completedVersions(GridCacheVersion completedBase, Collection<GridCacheVersion> committedVers, Collection<GridCacheVersion> rolledbackVers)
completedVersions in interface GridCacheTxEx<K,V>completedVersions in class GridCacheTxAdapter<K,V>completedBase - Base for committed versions.committedVers - Committed transactions relative to base.rolledbackVers - Rolled back transactions relative to base.public GridCacheVersion completedBase()
public Collection<GridCacheVersion> committedVersions()
public Collection<GridCacheVersion> rolledbackVersions()
public void userRollback()
throws GridException
userRollback in interface GridCacheTxLocalEx<K,V>GridException - If rollback failed.public GridFuture<Map<K,V>> getAllAsync(Collection<? extends K> keys, @Nullable GridCacheEntryEx<K,V> cached, GridPredicate<GridCacheEntry<K,V>>[] filter)
getAllAsync in interface GridCacheTxLocalEx<K,V>keys - Keys to get.cached - Cached entry if this method is called from entry wrapper.
Cached entry is passed if and only if there is only one key in collection of keys.filter - Entry filter.public V put(K key, V val, @Nullable GridCacheEntryEx<K,V> cached, long ttl, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
put in interface GridCacheTxLocalEx<K,V>key - Key.val - Value.cached - Cached cache entry, if called from entry wrapper.ttl - Entry time-to-live value. If negative, leave unchanged.filter - Filter.GridException - If put failed.public boolean putx(K key, V val, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
putx in interface GridCacheTxLocalEx<K,V>key - Key.val - Value.filter - Filter.True if put succeeded.GridException - If put failed.public boolean putx(K key, V val, @Nullable GridCacheEntryEx<K,V> cached, long ttl, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
putx in interface GridCacheTxLocalEx<K,V>key - Key.val - Value.cached - Cached cache entry, if called from entry wrapper.ttl - Time to live for entry. If negative, leave unchanged.filter - Filter.True if put succeeded.GridException - If put failed.public GridCacheReturn<V> putAll(Map<? extends K,? extends V> map, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
putAll in interface GridCacheTxLocalEx<K,V>map - Map to put.filter - Filter.GridException - If put failed.public GridFuture<V> putAsync(K key, V val, GridPredicate<GridCacheEntry<K,V>>[] filter)
putAsync in interface GridCacheTxLocalEx<K,V>key - Key.val - Value.filter - Filter.public GridFuture<V> putAsync(K key, V val, @Nullable GridCacheEntryEx<K,V> cached, long ttl, GridPredicate<GridCacheEntry<K,V>>[] filter)
putAsync in interface GridCacheTxLocalEx<K,V>key - Key.val - Value.cached - Optional cached cache entry.ttl - Time to live for entry. If negative, leave unchanged.filter - Filter.public GridFuture<GridCacheReturn<V>> putAllAsync(Map<? extends K,? extends V> map, boolean retval, @Nullable GridCacheEntryEx<K,V> cached, long ttl, GridPredicate<GridCacheEntry<K,V>>[] filter)
putAllAsync in interface GridCacheTxLocalEx<K,V>map - Map to put.retval - Flag indicating whether a value should be returned.cached - Cached entry, if any. Will be provided only if map has size 1.ttl - Time to live for entry. If negative, leave unchanged.filter - Filter.GridCacheTxLocalEx.put(Object, Object, GridCacheEntryEx, long, GridPredicate[]) was called.public GridFuture<Boolean> putxAsync(K key, V val, GridPredicate<GridCacheEntry<K,V>>[] filter)
putxAsync in interface GridCacheTxLocalEx<K,V>key - Key.val - Value.filter - Filter.public GridFuture<Boolean> putxAsync(K key, V val, @Nullable GridCacheEntryEx<K,V> cached, long ttl, GridPredicate<GridCacheEntry<K,V>>[] filter)
putxAsync in interface GridCacheTxLocalEx<K,V>key - Key.val - Value.cached - Optional cached cache entry.ttl - Time to live for entry. If negative, leave unchanged.filter - Filter.public GridFuture<GridCacheReturn<V>> putxAsync0(K key, V val, @Nullable GridCacheEntryEx<K,V> cached, long ttl, GridPredicate<GridCacheEntry<K,V>>[] filter)
putxAsync0 in interface GridCacheTxLocalEx<K,V>key - Key.val - Value.cached - Optional cached cache entry.ttl - Time to live for entry. If negative, leave unchanged.filter - Filter.public void putAllDr(Map<? extends K,GridCacheDrInfo<V>> drMap) throws GridException
putAllDr in interface GridCacheTxLocalEx<K,V>drMap - DR map to put.GridException - If put failed.public GridFuture<?> putAllDrAsync(Map<? extends K,GridCacheDrInfo<V>> drMap)
putAllDrAsync in interface GridCacheTxLocalEx<K,V>drMap - DR map to put.GridCacheTxLocalEx.put(Object, Object, GridCacheEntryEx, long, GridPredicate[]) was called.public boolean transform(K key, GridClosure<V,V> transformer) throws GridException
transform in interface GridCacheTxLocalEx<K,V>key - Key.transformer - Value transform closure.True if put succeeded.GridException - If put failed.public <R> R transformCompute(K key, GridClosure<V,GridBiTuple<V,R>> transformer) throws GridException
transformCompute in interface GridCacheTxLocalEx<K,V>key - Key.transformer - Closure.GridException - If failed.public void transformAll(@Nullable Map<? extends K,? extends GridClosure<V,V>> map) throws GridException
transformAll in interface GridCacheTxLocalEx<K,V>map - Map to put.GridException - If put failed.public GridFuture<Boolean> transformAsync(K key, GridClosure<V,V> transformer, @Nullable GridCacheEntryEx<K,V> cached, long ttl)
transformAsync in interface GridCacheTxLocalEx<K,V>key - Key.transformer - Value transform closure.cached - Cached entry, if called from entry wrapper.ttl - Entry time-to-live value. If negative, leave unchanged.public GridFuture<?> transformAllAsync(@Nullable Map<? extends K,? extends GridClosure<V,V>> map)
transformAllAsync in interface GridCacheTxLocalEx<K,V>map - Map to put.public V remove(K key, @Nullable GridCacheEntryEx<K,V> cached, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
remove in interface GridCacheTxLocalEx<K,V>key - Key.cached - Cached entry, if any.filter - Filter.GridException - If remove failed.public boolean removex(K key, @Nullable GridCacheEntryEx<K,V> cached, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
removex in interface GridCacheTxLocalEx<K,V>key - Key.cached - Cached entry, if any.filter - Filter.GridException - If remove failed.public GridCacheReturn<V> removeAll(Collection<? extends K> keys, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
removeAll in interface GridCacheTxLocalEx<K,V>keys - Keys to remove.filter - Filter.GridException - If remove failed.public GridFuture<V> removeAsync(K key, @Nullable GridCacheEntryEx<K,V> cached, GridPredicate<GridCacheEntry<K,V>>[] filter)
removeAsync in interface GridCacheTxLocalEx<K,V>key - Key to remove.cached - Cached entry, if any.filter - Filter.public GridFuture<Boolean> removexAsync(K key, @Nullable GridCacheEntryEx<K,V> cached, GridPredicate<GridCacheEntry<K,V>>[] filter)
removexAsync in interface GridCacheTxLocalEx<K,V>key - Key to remove.cached - Cached entry, if any.filter - Filter.public GridFuture<GridCacheReturn<V>> removexAsync0(K key, @Nullable GridCacheEntryEx<K,V> cached, GridPredicate<GridCacheEntry<K,V>>[] filter)
removexAsync0 in interface GridCacheTxLocalEx<K,V>key - Key to remove.cached - Optional cached entry.filter - Filter.public void removeAllDr(Map<? extends K,GridCacheVersion> drMap) throws GridException
removeAllDr in interface GridCacheTxLocalEx<K,V>drMap - DR map.GridException - If remove failed.public GridFuture<?> removeAllDrAsync(Map<? extends K,GridCacheVersion> drMap)
removeAllDrAsync in interface GridCacheTxLocalEx<K,V>drMap - DR map.protected GridFuture<Set<K>> enlistWrite(Collection<? extends K> keys, @Nullable GridCacheEntryEx<K,V> cached, long ttl, boolean implicit, @Nullable Map<? extends K,? extends V> lookup, @Nullable Map<? extends K,? extends GridClosure<V,V>> transformMap, boolean retval, boolean lockOnly, GridPredicate<GridCacheEntry<K,V>>[] filter, GridCacheReturn<V> ret, Collection<K> enlisted, @Nullable Map<? extends K,GridCacheDrInfo<V>> drPutMap, @Nullable Map<? extends K,GridCacheVersion> drRmvMap)
keys - Keys to enlist.cached - Cached entry.ttl - Time to live for entry. If negative, leave unchanged.implicit - Implicit flag.lookup - Value lookup map (null for remove).transformMap - Map with transform closures if this is a transform operation.retval - Flag indicating whether a value should be returned.lockOnly - If true, then entry will be enlisted as noop.filter - User filters.ret - Return value.enlisted - Collection of keys enlisted into this transaction.drPutMap - DR put map (optional).drRmvMap - DR remove map (optional).protected Set<K> postLockWrite(Iterable<? extends K> keys, Set<K> failed, @Nullable Map<K,V> transformed, @Nullable Map<? extends K,? extends GridClosure<V,V>> transformMap, GridCacheReturn<V> ret, boolean rmv, boolean retval, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
keys - Keys.failed - Collection of potentially failed keys (need to populate in this method).transformed - Output map where transformed values will be placed.transformMap - Transform map.ret - Return value.rmv - True if remove.retval - Flag to return value or not.filter - Filter to check entries.GridException - If error.public GridFuture<GridCacheReturn<V>> removeAllAsync(Collection<? extends K> keys, @Nullable GridCacheEntryEx<K,V> cached, boolean implicit, boolean retval, GridPredicate<GridCacheEntry<K,V>>[] filter)
removeAllAsync in interface GridCacheTxLocalEx<K,V>keys - Keys to remove.cached - Cached entry, if any. Will be provided only if size of keys collection is 1.implicit - Allows to externally control how transaction handles implicit flags.retval - Flag indicating whether a value should be returned.filter - Filter.protected void addGroupTxMapping(Collection<K> keys)
keys - Keys to add.public GridFuture<?> groupLockAsync(Collection<K> keys)
groupLockAsync in interface GridCacheTxLocalEx<K,V>keys - Keys to lock.public boolean init()
True if transaction was successfully started.protected void checkValid(GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
filter - Optional array of filters to check for optimistic transactions.GridException - If transaction failed.public Collection<GridCacheVersion> alternateVersions()
alternateVersions in interface GridCacheTxEx<K,V>protected final GridCacheTxEntry<K,V> addEntry(GridCacheOperation op, @Nullable V val, @Nullable GridClosure<V,V> transformClos, GridCacheEntryEx<K,V> entry, long ttl, GridPredicate<GridCacheEntry<K,V>>[] filter, boolean filtersSet, long drTtl, long drExpireTime, @Nullable GridCacheVersion drVer)
op - Cache operation.val - Value.ttl - Time to leave to set to tx entry. If null, leave unchanged.transformClos - Transform closure.entry - Cache entry.filter - Filter.filtersSet - True if filter should be marked as set.drTtl - DR TTL (if any).drExpireTime - DR expire time (if any).drVer - DR version.protected void updateExplicitVersion(GridCacheTxEntry<K,V> txEntry, GridCacheEntryEx<K,V> entry) throws GridCacheEntryRemovedException
txEntry - Tx entry to update.entry - Entry.GridCacheEntryRemovedException - If entry was concurrently removed.protected boolean isBatchUpdate()
True if updates should be batched up.protected boolean isSingleUpdate()
True if updates should be done individually.public String toString()
toString in class GridCacheTxAdapter<K,V>Copyright © 2014. All rights reserved.