public class GridDhtColocatedCache<K,V> extends GridDhtTransactionalCacheAdapter<K,V>
GridDhtCacheAdapter.GridSubjectIdAddedMessageConverter616GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.FutureHolderpreldr, SUBJECT_ID_EVENTS_SINCE_VERafterPessimisticUnlock, beforePessimisticLock, cacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, ctx, gridCfg, lastFut, locNodeId, log, map, metrics| Constructor and Description |
|---|
GridDhtColocatedCache()
Empty constructor required for
Externalizable |
GridDhtColocatedCache(GridCacheContext<K,V> ctx) |
GridDhtColocatedCache(GridCacheContext<K,V> ctx,
GridCacheConcurrentMap<K,V> map)
Creates colocated cache with specified map.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(K key,
GridPredicate<GridCacheEntry<K,V>> filter) |
GridCacheEntry<K,V> |
entry(K key)
Gets entry from cache with the specified key.
|
protected GridCacheEntryEx<K,V> |
entryExSafe(K key,
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)
This method is used internally.
|
protected void |
init()
Post constructor initialization for subclasses.
|
boolean |
isColocated() |
boolean |
isLocked(K key)
Checks if any node owns a lock for this key.
|
boolean |
isLockedByThread(K key)
Checks if current thread owns a lock on this key.
|
GridFuture<Map<K,V>> |
loadAsync(Collection<? extends K> keys,
boolean reload,
boolean forcePrimary,
long topVer,
UUID subjId,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
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)
This is an entry point to pessimistic locking within transaction.
|
GridNearTransactionalCache<K,V> |
near() |
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) |
V |
peek(K key,
Collection<GridCachePeekMode> modes)
Peeks at cached value using optional set of peek modes.
|
GridFuture<GridCacheTxEx<K,V>> |
prepareTxLocally(GridDhtColocatedTxLocal<K,V> tx,
Collection<GridCacheTxEntry<K,V>> reads,
Collection<GridCacheTxEntry<K,V>> writes,
Map<UUID,Collection<UUID>> txNodes,
boolean last,
Collection<UUID> lastBackups) |
void |
removeLocks(long threadId,
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.
|
void |
unlockAll(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Unlocks given keys only if current thread owns the locks.
|
commitTx, dgc, dgc, finish, lockAllAsync, lockAllAsyncInternal, prepareTx, processDhtLockRequest, processDhtLockRequest0, processDhtTxFinishRequest, processDhtTxFinishRequest0, processDhtTxPrepareRequest, processDhtUnlockRequest, removeLocks, rollbackTx, sendReplybeginMultiUpdate, dhtPreloader, endMultiUpdate, entryEx, entryEx, entryExx, entryExx, entryExx, entrySet, getDhtAsync, loadCache, multiUpdateFinishFuture, multiUpdateTopologyFuture, onDeferredDelete, onKernalStart, onKernalStop, peekExx, preloader, primarySize, printMemoryStats, processNearGetRequest, reload, splitClearAll, stop, topology, toStringlockAllAsync, removeVersionedEntry, txLockAsyncaffinity, afterPessimisticUnlock, afterPessimisticUnlock, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, beforePessimisticLock, beforePessimisticLock, cache, checkJta, clear, clear0, clearAll, clearAll, clearAll0, compact, compact, compactAll, compactAll, configuration, containsAllKeys, containsAllValues, containsAnyKeys, containsAnyValues, containsKey, containsValue, containsValue, context, dataStructures, drBackupQueueSize, drListStateTransfers, drPause, drPauseState, drResume, drStateTransfer, entries, entryEx, entrySet, entrySet, entrySet, entrySetx, evict, evict, evictAll, evictAll, evictAll, flags, flagsOff, flagsOn, forAll, forceRepartition, forEach, forSubjectId, get, get, get, getAll, getAll, getAllAsync, getAllAsync, getAllAsync, getAllOutTx, getAllOutTxAsync, getAsync, getAsync, getForcePrimary, getForcePrimaryAsync, ggfsDataSpaceMax, ggfsDataSpaceUsed, globalClearAll, gridProjection, isDht, isDhtAtomic, isDrSystemCache, isEmpty, isGgfsDataCache, isLocal, isMongoDataCache, isMongoMetaCache, isNear, iterator, keySet, keySet, loadCacheAsync, lock, lockAll, lockAsync, log, map, metrics, metrics0, name, nearSize, offHeapAllocatedSize, offHeapEntriesCount, offHeapIterator, onGgfsDataSizeChanged, onUndeploy, overflowSize, peek, peek, peek0, peek0, peek0, peekAll, peekAll0, peekAll0, peekEx, predicate, primaryEntrySet, primaryEntrySet, primaryKeySet, primaryKeySet, primaryValues, primaryValues, processCheckCommittedTxRequest, processCheckCommittedTxResponse, processCheckPreparedTxRequest, processCheckPreparedTxResponse, projection, projection, projection, promote, promoteAll, put, put, putAll, putAllAsync, putAllDr, putAllDrAsync, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, putx, putx, putxAsync, putxAsync, putxIfAbsent, putxIfAbsentAsync, queries, randomEntry, readExternal, readResolve, readThroughAllAsync, reload, reloadAll, reloadAll, reloadAll, reloadAll, reloadAll, reloadAllAsync, reloadAllAsync, reloadAllAsync, 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, resetMetrics, saveFuture, size, startInfo, stopInfo, swapIterator, swapKeys, swapSize, toMap, transform, transformAll, transformAll, transformAllAsync, transformAllAsync, transformAndCompute, transformAsync, transformAsync, tx, txStart, txStart, txStart, txStartAffinity, txStartPartition, txSynchronizations, txSynchronize, txUnsynchronize, unlock, values, 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 GridDhtColocatedCache()
Externalizablepublic GridDhtColocatedCache(GridCacheContext<K,V> ctx)
ctx - Cache context.public GridDhtColocatedCache(GridCacheContext<K,V> ctx, GridCacheConcurrentMap<K,V> map)
ctx - Cache context.map - Cache map.public boolean isColocated()
isColocated in class GridCacheAdapter<K,V>True if cache is colocated.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 GridDhtCacheAdapter<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 void init()
init in class GridDhtCacheAdapter<K,V>public void start()
throws GridException
start in class GridDhtTransactionalCacheAdapter<K,V>GridException - If start failed.public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws GridException
non-null value is found, it will be immediately returned.
Note that if modes are not provided this method works exactly the same way as
GridCacheProjection.peek(Object), implicitly using GridCachePeekMode.SMART mode.
peek in interface GridCacheProjection<K,V>peek in class GridCacheAdapter<K,V>key - Entry key.modes - Optional set of peek modes.GridException - If peek operation failed.public boolean isLocked(K key)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
isLocked in interface GridCacheProjection<K,V>isLocked in class GridCacheAdapter<K,V>key - Key to check.True if lock is owned by some node.public boolean isLockedByThread(K key)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
isLockedByThread in interface GridCacheProjection<K,V>isLockedByThread in class GridCacheAdapter<K,V>key - Key to check.True if key is locked by current thread.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)
GridDhtCacheAdapter.getDhtAsync(UUID, long, LinkedHashMap, boolean, long, UUID, GridPredicate[])
method instead to retrieve DHT value.getAllAsync in class GridDhtCacheAdapter<K,V>keys - forcePrimary - skipTx - filter - protected GridCacheEntryEx<K,V> entryExSafe(K key, long topVer)
entryExSafe in class GridCacheAdapter<K,V>key - Key.public boolean containsKey(K key, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
containsKey in class GridCacheAdapter<K,V>key - Key.filter - Filters to evaluate.True if contains key.public GridFuture<Map<K,V>> loadAsync(@Nullable Collection<? extends K> keys, boolean reload, boolean forcePrimary, long topVer, @Nullable UUID subjId, @Nullable GridPredicate<GridCacheEntry<K,V>>[] filter)
keys - Keys to load.reload - Reload flag.forcePrimary - Force get from primary node flag.filter - Filter.public GridFuture<Boolean> lockAllAsync(Collection<? extends K> keys, long timeout, @Nullable GridCacheTxLocalEx<K,V> tx, boolean isInvalidate, boolean isRead, boolean retval, @Nullable GridCacheTxIsolation isolation, GridPredicate<GridCacheEntry<K,V>>[] filter)
lockAllAsync in class GridDhtTransactionalCacheAdapter<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.public GridNearTransactionalCache<K,V> near()
near in class GridDhtTransactionalCacheAdapter<K,V>public GridCacheEntry<K,V> entry(K key) throws GridDhtInvalidPartitionException
Note that this method can return null if projection is configured as
pre-filtered and entry key and value don't pass key-value filter of the projection.
entry in interface GridCacheProjection<K,V>entry in class GridDhtCacheAdapter<K,V>key - Entry key.null if projection pre-filtering was not passed.GridDhtInvalidPartitionException - If partition for the key is no longer valid.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.unlockAll in interface GridCacheProjection<K,V>unlockAll in class GridDhtCacheAdapter<K,V>keys - Keys to unlock.filter - Optional filter which needs to pass for individual entries
to be unlocked.public void removeLocks(long threadId,
GridCacheVersion ver,
Collection<? extends K> keys)
threadId - Thread ID.ver - Lock version.keys - Keys.public GridFuture<GridCacheTxEx<K,V>> prepareTxLocally(GridDhtColocatedTxLocal<K,V> tx, Collection<GridCacheTxEntry<K,V>> reads, Collection<GridCacheTxEntry<K,V>> writes, Map<UUID,Collection<UUID>> txNodes, boolean last, Collection<UUID> lastBackups)
tx - Started colocated transaction to prepare.reads - Read collection.writes - Write collection.txNodes - Transaction nodes mapping.last - True if this is last prepare operation.lastBackups - IDs of backup nodes receiving last prepare request.Copyright © 2014. All rights reserved.