public class GridDhtColocatedCache<K,V> extends GridDhtTransactionalCacheAdapter<K,V>
GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.CacheExpiryPolicy, GridCacheAdapter.FutureHolder, GridCacheAdapter.TopologyVersionAwareJob, GridCacheAdapter.UpdateGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutAndGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveTimeStatClosure<T>, GridCacheAdapter.UpdateTimeStatClosure<T>preldrcacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, clusterMxBean, ctx, gridCfg, keyCheck, lastFut, LOAD_CACHE_JOB_SINCE, LOAD_CACHE_JOB_V2_SINCE, localMxBean, locNodeId, log, map, MAX_RETRIES, metrics, RET2NULL, txLockMsgLog| Constructor and Description |
|---|
GridDhtColocatedCache()
Empty constructor required for
Externalizable |
GridDhtColocatedCache(GridCacheContext<K,V> ctx) |
GridDhtColocatedCache(GridCacheContext<K,V> ctx,
GridCacheConcurrentMap map)
Creates colocated cache with specified map.
|
| Modifier and Type | Method and Description |
|---|---|
protected GridCacheEntryEx |
entryExSafe(KeyCacheObject key,
AffinityTopologyVersion topVer) |
GridDistributedCacheEntry |
entryExx(KeyCacheObject key,
AffinityTopologyVersion topVer,
boolean allowDetached)
Gets or creates entry for given key and given topology version.
|
protected GridCacheMapEntryFactory |
entryFactory() |
IgniteInternalFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys,
boolean forcePrimary,
boolean skipTx,
UUID subjId,
String taskName,
boolean deserializeBinary,
boolean skipVals,
boolean canRemap,
boolean needVer)
This method is used internally.
|
protected IgniteInternalFuture<V> |
getAsync(K key,
boolean forcePrimary,
boolean skipTx,
UUID subjId,
String taskName,
boolean deserializeBinary,
boolean skipVals,
boolean canRemap,
boolean needVer) |
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.
|
IgniteInternalFuture<Map<K,V>> |
loadAsync(Collection<KeyCacheObject> keys,
boolean readThrough,
boolean forcePrimary,
AffinityTopologyVersion topVer,
UUID subjId,
String taskName,
boolean deserializeBinary,
IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
boolean canRemap,
boolean needVer) |
IgniteInternalFuture<Map<K,V>> |
loadAsync(Collection<KeyCacheObject> keys,
boolean readThrough,
boolean forcePrimary,
AffinityTopologyVersion topVer,
UUID subjId,
String taskName,
boolean deserializeBinary,
IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
boolean canRemap,
boolean needVer,
boolean keepCacheObj) |
IgniteInternalFuture<Object> |
loadAsync(KeyCacheObject key,
boolean readThrough,
boolean forcePrimary,
AffinityTopologyVersion topVer,
UUID subjId,
String taskName,
boolean deserializeBinary,
IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals,
boolean canRemap,
boolean needVer,
boolean keepCacheObj) |
IgniteInternalFuture<Boolean> |
lockAllAsync(Collection<KeyCacheObject> keys,
long timeout,
IgniteTxLocalEx tx,
boolean isInvalidate,
boolean isRead,
boolean retval,
TransactionIsolation isolation,
long accessTtl)
This is an entry point to pessimistic locking within transaction.
|
GridNearTransactionalCache<K,V> |
near() |
void |
removeLocks(long threadId,
GridCacheVersion ver,
Collection<KeyCacheObject> keys)
Removes locks regardless of whether they are owned or not for given
version and keys.
|
void |
start()
Starts this cache.
|
String |
toString() |
void |
unlockAll(Collection<? extends K> keys)
Unlocks given keys only if current thread owns the locks.
|
lockAllAsync, lockAllAsyncInternal, processDhtLockRequest, processDhtLockRequest0, processDhtUnlockRequest, removeLocksbeginMultiUpdate, createEntry, dhtPreloader, endMultiUpdate, entryEx, entryEx, entryExx, entryExx, entrySet, getDhtAsync, init, localEntriesIterator, localLoad, localLoadCache, multiUpdateFinishFuture, multiUpdateTopologyFuture, needRemap, onDeferredDelete, onKernalStart, onKernalStop, onReconnected, peekExx, preloader, primarySize, primarySizeLong, printMemoryStats, processNearGetRequest, processNearGetResponse, processNearSingleGetRequest, processNearSingleGetResponse, sendTtlUpdateRequest, splitClearLocally, stop, topologylockAllAsync, removeAll, removeAllAsync, removeVersionedEntry, txLockAsyncaffinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, awaitLastFut, cache, checkJta, clear, clear, clearAll, clearAllAsync, clearAsync, clearAsync, clearLocally, clearLocally, clearLocally, clearLocallyAll, clusterMetrics, clusterMetrics, clusterMxBean, commitTxAsync, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, context, decrementSize, entries, entryEx, entryEx, entrySet, entrySet, entrySetx, evict, evictAll, expiry, expiryPolicy, forSubjectId, get, get, get, getAll, getAll, getAllAsync, getAllAsync, getAllAsync, getAllAsync0, getAllOutTx, getAllOutTxAsync, getAndPut, getAndPut, getAndPutAsync, getAndPutAsync, getAndPutAsync0, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove, getAndRemoveAsync, getAndReplace, getAndReplaceAsync, getAsync, getAsync, getEntries, getEntriesAsync, getEntry, getEntryAsync, getForcePrimary, getForcePrimaryAsync, getTopologySafe, igfsDataSpaceMax, igfsDataSpaceUsed, igniteIterator, igniteIterator, incrementSize, invoke, invoke, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAsync, isDht, isDhtAtomic, isEmpty, isIgfsDataCache, isLocal, isMongoDataCache, isMongoMetaCache, isNear, iterator, iterator, keepBinary, keySet, keySetx, loadAll, localEntries, localLoadCacheAsync, localMetrics, localMxBean, localPeek, localSize, localSizeLong, localSizeLong, lock, lockAll, lockAsync, log, map, metrics0, name, nearSize, offHeapAllocatedSize, offHeapEntriesCount, onIgfsDataSizeChanged, onUndeploy, overflowSize, peekEx, peekEx, primaryKeySet, promote, promoteAll, put, put, putAll, putAllAsync, putAllConflict, putAllConflictAsync, putAsync, putAsync, putAsync0, putIfAbsent, putIfAbsentAsync, randomEntry, readExternal, readResolve, rebalance, remove, remove, removeAll, removeAllAsync, removeAllConflict, removeAllConflictAsync, removeAsync, removeAsync, removeAsync, removeEntry, removeIfObsolete, replace, replace, replaceAsync, replaceAsync, saveFuture, setSkipStore, size, size, sizeAsync, sizeLong, sizeLong, sizeLong, sizeLongAsync, sizeLongAsync, skipStore, startInfo, stopInfo, swapKeys, swapSize, tryGetAndPut, tx, txStart, txStart, txStartEx, unlock, validateCacheKey, validateCacheKeys, values, values, withExpiryPolicy, withNoRetries, writeExternalpublic GridDhtColocatedCache()
Externalizablepublic GridDhtColocatedCache(GridCacheContext<K,V> ctx)
ctx - Cache context.public GridDhtColocatedCache(GridCacheContext<K,V> ctx, GridCacheConcurrentMap map)
ctx - Cache context.map - Cache map.public boolean isColocated()
isColocated in class GridCacheAdapter<K,V>True if cache is colocated.protected GridCacheMapEntryFactory entryFactory()
entryFactory in class GridDhtCacheAdapter<K,V>public void start()
throws IgniteCheckedException
start in class GridDhtTransactionalCacheAdapter<K,V>IgniteCheckedException - If start failed.public GridDistributedCacheEntry entryExx(KeyCacheObject key, AffinityTopologyVersion topVer, boolean allowDetached)
key - Key for entry.topVer - Topology version.allowDetached - Whether to allow detached entries. If true and node is not primary
for given key, a new detached entry will be created. Otherwise, entry will be obtained from
dht cache map.GridDhtInvalidPartitionException - If allowDetached is false and node is not primary
for given key.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 IgniteInternalCache<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 IgniteInternalCache<K,V>isLockedByThread in class GridCacheAdapter<K,V>key - Key to check.True if key is locked by current thread.protected IgniteInternalFuture<V> getAsync(K key, boolean forcePrimary, boolean skipTx, @Nullable UUID subjId, String taskName, boolean deserializeBinary, boolean skipVals, boolean canRemap, boolean needVer)
getAsync in class GridCacheAdapter<K,V>key - Key.forcePrimary - Force primary.skipTx - Skip tx.subjId - Subj Id.taskName - Task name.deserializeBinary - Deserialize binary.skipVals - Skip values.canRemap - Can remap flag.needVer - Need version.public IgniteInternalFuture<Map<K,V>> getAllAsync(@Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, @Nullable UUID subjId, String taskName, boolean deserializeBinary, boolean skipVals, boolean canRemap, boolean needVer)
GridDhtCacheAdapter.getDhtAsync(UUID, long, Map, boolean, AffinityTopologyVersion, UUID, int, IgniteCacheExpiryPolicy, boolean)
method instead to retrieve DHT value.getAllAsync in class GridDhtCacheAdapter<K,V>keys - Keys.forcePrimary - Force primary.skipTx - Skip tx.subjId - Subj Id.taskName - Task name.deserializeBinary - Deserialize binary.skipVals - Skip values.canRemap - Can remap flag.needVer - Need version.GridCacheAdapter.getAllAsync(Collection)protected GridCacheEntryEx entryExSafe(KeyCacheObject key, AffinityTopologyVersion topVer)
entryExSafe in class GridCacheAdapter<K,V>key - Key.topVer - Topology version.public IgniteInternalFuture<Map<K,V>> loadAsync(@Nullable Collection<KeyCacheObject> keys, boolean readThrough, boolean forcePrimary, AffinityTopologyVersion topVer, @Nullable UUID subjId, String taskName, boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, boolean needVer)
keys - Keys to load.readThrough - Read through flag.forcePrimary - Force get from primary node flag.topVer - Topology version.subjId - Subject ID.taskName - Task name.deserializeBinary - Deserialize binary flag.expiryPlc - Expiry policy.skipVals - Skip values flag.canRemap - Can remap flag.needVer - Need version.public final IgniteInternalFuture<Object> loadAsync(KeyCacheObject key, boolean readThrough, boolean forcePrimary, AffinityTopologyVersion topVer, @Nullable UUID subjId, String taskName, boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, boolean needVer, boolean keepCacheObj)
key - Key to load.readThrough - Read through flag.forcePrimary - Force get from primary node flag.topVer - Topology version.subjId - Subject ID.taskName - Task name.deserializeBinary - Deserialize binary flag.expiryPlc - Expiry policy.skipVals - Skip values flag.canRemap - Flag indicating whether future can be remapped on a newer topology version.needVer - If true returns values as tuples containing value and version.keepCacheObj - Keep cache objects flag.public final IgniteInternalFuture<Map<K,V>> loadAsync(@Nullable Collection<KeyCacheObject> keys, boolean readThrough, boolean forcePrimary, AffinityTopologyVersion topVer, @Nullable UUID subjId, String taskName, boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, boolean needVer, boolean keepCacheObj)
keys - Keys to load.readThrough - Read through flag.forcePrimary - Force get from primary node flag.topVer - Topology version.subjId - Subject ID.taskName - Task name.deserializeBinary - Deserialize binary flag.expiryPlc - Expiry policy.skipVals - Skip values flag.canRemap - Flag indicating whether future can be remapped on a newer topology version.needVer - If true returns values as tuples containing value and version.keepCacheObj - Keep cache objects flag.public IgniteInternalFuture<Boolean> lockAllAsync(Collection<KeyCacheObject> keys, long timeout, @Nullable IgniteTxLocalEx tx, boolean isInvalidate, boolean isRead, boolean retval, @Nullable TransactionIsolation isolation, long accessTtl)
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.accessTtl - TTL for read operation.public GridNearTransactionalCache<K,V> near()
near in class GridDhtTransactionalCacheAdapter<K,V>public void unlockAll(Collection<? extends K> keys)
TransactionConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.unlockAll in interface IgniteInternalCache<K,V>unlockAll in class GridDhtCacheAdapter<K,V>keys - Keys to unlock.public void removeLocks(long threadId,
GridCacheVersion ver,
Collection<KeyCacheObject> keys)
threadId - Thread ID.ver - Lock version.keys - Keys.public String toString()
toString in class GridDhtCacheAdapter<K,V>
Follow @ApacheIgnite
Ignite Fabric : ver. 1.7.0 Release Date : August 1 2016