public class GridNearTransactionalCache<K,V> extends GridNearCacheAdapter<K,V>
GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.FutureHolderafterPessimisticUnlock, beforePessimisticLock, cacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, ctx, gridCfg, lastFut, locNodeId, log, map, metrics| Constructor and Description |
|---|
GridNearTransactionalCache()
Empty constructor required for
Externalizable. |
GridNearTransactionalCache(GridCacheContext<K,V> ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearLocks(UUID nodeId,
GridDhtUnlockRequest<K,V> req) |
void |
dgc()
Runs DGC procedure on demand using
GridCacheConfiguration.getDgcSuspectLockTimeout() to identify suspect locks. |
void |
dgc(long suspectLockTimeout,
boolean global,
boolean rmvLocks)
Runs DGC procedure on demand using provided parameter to identify suspect locks.
|
GridDhtCache<K,V> |
dht() |
void |
dht(GridDhtCache<K,V> dht) |
protected boolean |
evictNearEntry(GridCacheEntryEx<K,V> e,
GridCacheVersion obsoleteVer,
long topVer) |
GridFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys,
boolean forcePrimary,
boolean skipTx,
GridCacheEntryEx<K,V> entry,
UUID subjId,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
protected boolean |
isNearLocallyMapped(GridCacheEntryEx<K,V> e,
long topVer) |
protected GridFuture<Boolean> |
lockAllAsync(Collection<? extends K> keys,
long timeout,
GridCacheTxLocalEx<K,V> tx,
boolean isInvalidate,
boolean isRead,
boolean retval,
GridCacheTxIsolation isolation,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridCacheTxLocalAdapter<K,V> |
newTx(boolean implicit,
boolean implicitSingle,
GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
boolean syncCommit,
boolean syncRollback,
boolean swapOrOffheapEnabled,
boolean storeEnabled,
int txSize,
Object grpLockKey,
boolean partLock) |
void |
onDeferredDelete(GridCacheEntryEx<K,V> entry,
GridCacheVersion ver) |
void |
removeLocks(GridCacheVersion ver,
Collection<? extends K> keys)
Removes locks regardless of whether they are owned or not for given
version and keys.
|
void |
start()
Starts this cache.
|
GridNearTxRemote<K,V> |
startRemoteTx(ClassLoader ldr,
UUID nodeId,
GridDhtTxPrepareRequest<K,V> req)
Called while processing dht tx prepare request.
|
GridNearTxRemote<K,V> |
startRemoteTx(UUID nodeId,
GridDhtLockRequest<K,V> req) |
GridNearTxRemote<K,V> |
startRemoteTxForFinish(UUID nodeId,
GridDhtTxFinishRequest<K,V> req) |
String |
toString() |
void |
unlockAll(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Unlocks given keys only if current thread owns the locks.
|
afterPessimisticUnlock, afterPessimisticUnlock, beforePessimisticLock, beforePessimisticLock, clear0, clearAll0, compact, containsKey, drBackupQueueSize, drListStateTransfers, drPause, drPauseState, drResume, drStateTransfer, entry, entryEx, entryEx, entryExx, entrySet, entrySet, evict, evictAll, evictNearOnly, ggfsDataSpaceMax, ggfsDataSpaceUsed, init, isAllLockedNearOnly, isGgfsDataCache, isLocked, isLockedNearOnly, isMongoDataCache, isMongoMetaCache, isNear, keySet, loadAsync, loadCache, loadCacheAsync, nearEntries, nearKeySet, nearSize, offHeapAllocatedSize, offHeapEntriesCount, offHeapIterator, onGgfsDataSizeChanged, peek, peek, peekAll, peekExx, peekNearOnly, preloader, primaryEntrySet, primaryKeySet, primarySize, primaryValues, processGetResponse, promote, promoteAll, readThroughAllAsync, reload, reloadAll, reloadAll, reloadAllAsync, reloadAllAsync, reloadAllAsync, resetMetrics, size, splitClearAll, swapIterator, swapKeys, swapSize, valueslockAllAsync, removeVersionedEntry, txLockAsyncaffinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, cache, checkJta, clear, clearAll, clearAll, compact, compactAll, compactAll, configuration, containsAllKeys, containsAllValues, containsAnyKeys, containsAnyValues, containsKey, containsValue, containsValue, context, dataStructures, entries, entryEx, entryExSafe, entrySet, entrySet, entrySetx, evict, evictAll, evictAll, flags, flagsOff, flagsOn, forAll, forceRepartition, forEach, forSubjectId, get, get, get, getAll, getAll, getAllAsync, getAllAsync, getAllAsync, getAllOutTx, getAllOutTxAsync, getAsync, getAsync, getForcePrimary, getForcePrimaryAsync, globalClearAll, gridProjection, isColocated, isDht, isDhtAtomic, isDrSystemCache, isEmpty, isLocal, isLockedByThread, iterator, keySet, lock, lockAll, lockAsync, log, map, metrics, metrics0, name, onKernalStart, onKernalStop, onUndeploy, overflowSize, peek, peek0, peek0, peek0, peekAll0, peekAll0, peekEx, predicate, primaryEntrySet, primaryKeySet, primaryValues, printMemoryStats, processCheckCommittedTxRequest, processCheckCommittedTxResponse, processCheckPreparedTxRequest, processCheckPreparedTxResponse, projection, projection, projection, put, put, putAll, putAllAsync, putAllDr, putAllDrAsync, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, putx, putx, putxAsync, putxAsync, putxIfAbsent, putxIfAbsentAsync, queries, randomEntry, readExternal, readResolve, reload, reloadAll, reloadAll, reloadAll, reloadAllAsync, reloadAllAsync, reloadAsync, reloadAsync, remove, remove, remove, removeAll, removeAll, removeAllAsync, removeAllAsync, removeAllDr, removeAllDrAsync, removeAsync, removeAsync, removeAsync, removeEntry, removeIfObsolete, removex, removex, removex, removexAsync, removexAsync, removexAsync, replace, replace, replaceAsync, replaceAsync, replacex, replacex, replacexAsync, replacexAsync, saveFuture, startInfo, stop, stopInfo, toMap, transform, transformAll, transformAll, transformAllAsync, transformAllAsync, transformAndCompute, transformAsync, transformAsync, tx, txStart, txStart, txStart, txStartAffinity, txStartPartition, txSynchronizations, txSynchronize, txUnsynchronize, unlock, values, wrappers, writeExternaladdMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, readExternalMeta, removeMeta, removeMeta, replaceMeta, writeExternalMetaequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMetapublic GridNearTransactionalCache()
Externalizable.public GridNearTransactionalCache(GridCacheContext<K,V> ctx)
ctx - Context.public void start()
throws GridException
start in class GridCacheAdapter<K,V>GridException - If start failed.public void dgc()
GridCacheConfiguration.getDgcSuspectLockTimeout() to identify suspect locks.
Method blocks current thread until locks are examined and all DGC requests are sent to remote nodes.
DGC does not remove locks if GridCacheConfiguration.isDgcRemoveLocks()
is set to false.
public void dgc(long suspectLockTimeout,
boolean global,
boolean rmvLocks)
Method blocks current thread until locks are examined and all DGC requests are sent
to remote nodes and (if global is true) all nodes running this cache
will get signal to start GC procedure.
dgc in interface GridCache<K,V>dgc in class GridCacheAdapter<K,V>suspectLockTimeout - Custom suspect lock timeout (should be greater than or equal to 0).global - If true then GC procedure will start on all nodes having this cache.rmvLocks - If false then DGC does not remove locks, just report them to log.public void dht(GridDhtCache<K,V> dht)
dht - DHT cache.public GridDhtCache<K,V> dht()
dht in class GridNearCacheAdapter<K,V>public GridFuture<Map<K,V>> getAllAsync(@Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, @Nullable GridCacheEntryEx<K,V> entry, @Nullable UUID subjId, @Nullable GridPredicate<GridCacheEntry<K,V>>[] filter)
getAllAsync in class GridCacheAdapter<K,V>public void clearLocks(UUID nodeId, GridDhtUnlockRequest<K,V> req)
nodeId - Node ID.req - Request.@Nullable public GridNearTxRemote<K,V> startRemoteTx(ClassLoader ldr, UUID nodeId, GridDhtTxPrepareRequest<K,V> req) throws GridException
ldr - Loader.nodeId - Sender node ID.req - Request.GridException - If failed.@Nullable public GridNearTxRemote<K,V> startRemoteTx(UUID nodeId, GridDhtLockRequest<K,V> req) throws GridException, GridDistributedLockCancelledException
nodeId - Primary node ID.req - Request.GridException - If failed.GridDistributedLockCancelledException - If lock has been cancelled.@Nullable public GridNearTxRemote<K,V> startRemoteTxForFinish(UUID nodeId, GridDhtTxFinishRequest<K,V> req) throws GridException, GridDistributedLockCancelledException
nodeId - Primary node ID.req - Request.GridException - If failed.GridDistributedLockCancelledException - If lock has been cancelled.public GridCacheTxLocalAdapter<K,V> newTx(boolean implicit, boolean implicitSingle, GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, boolean invalidate, boolean syncCommit, boolean syncRollback, boolean swapOrOffheapEnabled, boolean storeEnabled, int txSize, @Nullable Object grpLockKey, boolean partLock)
newTx in class GridCacheAdapter<K,V>implicit - True if transaction is implicit.implicitSingle - Implicit-with-single-key flag.concurrency - Concurrency.isolation - Isolation.timeout - transaction timeout.invalidate - Invalidation flag.syncCommit - Synchronous commit flag.syncRollback - Synchronous rollback flag.swapOrOffheapEnabled - If true then swap storage will be used.storeEnabled - if true then read/write through will be used.txSize - Expected transaction size.grpLockKey - Group lock key if this is a group-lock transaction.partLock - True if partition is locked.protected GridFuture<Boolean> lockAllAsync(Collection<? extends K> keys, long timeout, GridCacheTxLocalEx<K,V> tx, boolean isInvalidate, boolean isRead, boolean retval, GridCacheTxIsolation isolation, GridPredicate<GridCacheEntry<K,V>>[] filter)
lockAllAsync in class GridDistributedCacheAdapter<K,V>keys - Keys to lock.timeout - Timeout.tx - TransactionisInvalidate - Invalidation flag.isRead - Indicates whether value is read or written.retval - Flag to return value.isolation - Transaction isolation.filter - Optional filter.protected boolean isNearLocallyMapped(GridCacheEntryEx<K,V> e, long topVer)
e - Transaction entry.True if entry is locally mapped as a primary or back up node.protected boolean evictNearEntry(GridCacheEntryEx<K,V> e, GridCacheVersion obsoleteVer, long topVer)
e - Entry to evict if it qualifies for eviction.obsoleteVer - Obsolete version.topVer - Topology version.True if attempt was made to evict the entry.public void unlockAll(Collection<? extends K> keys, GridPredicate<GridCacheEntry<K,V>>[] filter)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.keys - Keys to unlock.filter - Optional filter which needs to pass for individual entries
to be unlocked.public void removeLocks(GridCacheVersion ver, Collection<? extends K> keys)
ver - Lock version.keys - Keys.public void onDeferredDelete(GridCacheEntryEx<K,V> entry, GridCacheVersion ver)
onDeferredDelete in class GridCacheAdapter<K,V>entry - Entry.ver - Version.public String toString()
toString in class GridNearCacheAdapter<K,V>Copyright © 2014. All rights reserved.