public abstract class GridDhtCacheAdapter<K,V> extends GridDistributedCacheAdapter<K,V>
| Modifier and Type | Class and Description |
|---|---|
protected class |
GridDhtCacheAdapter.MessageHandler<M> |
GridDistributedCacheAdapter.GlobalRemoveAllJob<K,V>GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.BulkOperation, GridCacheAdapter.CacheExpiryPolicy, GridCacheAdapter.FutureHolder, GridCacheAdapter.InvokeAllTimeStatClosure<T>, GridCacheAdapter.PeekModes, GridCacheAdapter.TopologyVersionAwareJob, GridCacheAdapter.UpdateGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutAndGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveTimeStatClosure<T>, GridCacheAdapter.UpdateTimeStatClosure<T>cacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, ctx, DFLT_CACHE_RETRIES_COUNT, DFLT_CACHE_START_SIZE, DFLT_START_CACHE_SIZE, lastFut, locNodeId, log, map, MAX_RETRIES, metrics, RET2NULL, txLockMsgLog| Modifier | Constructor and Description |
|---|---|
protected |
GridDhtCacheAdapter()
Empty constructor required for
Externalizable. |
protected |
GridDhtCacheAdapter(GridCacheContext<K,V> ctx) |
protected |
GridDhtCacheAdapter(GridCacheContext<K,V> ctx,
GridCacheConcurrentMap map)
Constructor used for near-only cache.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addFuture(GridDhtForceKeysFuture<?,?> fut)
Adds future to future map.
|
protected GridDistributedCacheEntry |
createEntry(KeyCacheObject key) |
void |
dumpDebugInfo() |
GridCacheEntryEx |
entryEx(KeyCacheObject key,
AffinityTopologyVersion topVer) |
GridDhtCacheEntry |
entryExx(KeyCacheObject key) |
GridDhtCacheEntry |
entryExx(KeyCacheObject key,
AffinityTopologyVersion topVer) |
IgniteInternalFuture<Map<K,V>> |
getAllAsync(@Nullable Collection<? extends K> keys,
boolean forcePrimary,
boolean skipTx,
@Nullable UUID subjId,
String taskName,
boolean deserializeBinary,
boolean recovery,
boolean readRepair,
boolean skipVals,
boolean needVer) |
GridDhtFuture<Collection<GridCacheEntryInfo>> |
getDhtAsync(UUID reader,
long msgId,
Map<KeyCacheObject,Boolean> keys,
boolean addReaders,
boolean readThrough,
AffinityTopologyVersion topVer,
@Nullable UUID subjId,
int taskNameHash,
@Nullable IgniteCacheExpiryPolicy expiry,
boolean skipVals,
boolean recovery,
@Nullable String txLbl,
MvccSnapshot mvccSnapshot) |
Iterator<javax.cache.Cache.Entry<K,V>> |
localEntriesIterator(boolean primary,
boolean backup,
boolean keepBinary) |
void |
localLoad(Collection<? extends K> keys,
javax.cache.expiry.ExpiryPolicy plc,
boolean keepBinary) |
void |
localLoadCache(IgniteBiPredicate<K,V> p,
Object[] args)
Delegates to
CacheStore.loadCache(IgniteBiInClosure, Object...) method
to load state from the underlying persistent storage. |
abstract GridNearCacheAdapter<K,V> |
near() |
protected boolean |
needRemap(AffinityTopologyVersion mapVer,
AffinityTopologyVersion curVer) |
void |
onDeferredDelete(GridCacheEntryEx entry,
GridCacheVersion ver) |
void |
onKernalStop()
Kernal stop callback.
|
@Nullable GridDhtCacheEntry |
peekExx(KeyCacheObject key) |
GridCachePreloader |
preloader() |
int |
primarySize()
Gets the number of all primary entries cached on this node.
|
long |
primarySizeLong()
Gets the number of all primary entries cached on this node as a long value.
|
void |
printMemoryStats()
Prints memory stats.
|
protected void |
processForceKeyResponse(ClusterNode node,
GridDhtForceKeysResponse msg) |
protected void |
processForceKeysRequest(ClusterNode node,
GridDhtForceKeysRequest msg) |
protected void |
processNearGetRequest(UUID nodeId,
GridNearGetRequest req) |
protected void |
processNearGetResponse(UUID nodeId,
GridNearGetResponse res) |
protected void |
processNearSingleGetRequest(UUID nodeId,
GridNearSingleGetRequest req) |
protected void |
processNearSingleGetResponse(UUID nodeId,
GridNearSingleGetResponse res) |
void |
removeFuture(GridDhtForceKeysFuture<?,?> fut)
Removes future from future map.
|
void |
sendTtlUpdateRequest(@Nullable IgniteCacheExpiryPolicy expiryPlc)
Initiates process of notifying all interested nodes that TTL was changed.
|
int |
size()
Gets the number of all entries cached on this node.
|
long |
sizeLong()
Gets the number of all entries cached on this node as a long value.
|
List<GridCacheClearAllRunnable<K,V>> |
splitClearLocally(boolean srv,
boolean near,
boolean readers)
Split clearLocally all task into multiple runnables.
|
void |
start()
Starts this cache.
|
GridDhtPartitionTopology |
topology() |
String |
toString() |
void |
unlockAll(Collection<? extends K> keys)
Unlocks given keys only if current thread owns the locks.
|
localSizeLong, localSizeLong, lockAllAsync, lockAllAsync, removeAll, removeAllAsync, removeVersionedEntry, txLockAsyncactive, active, affinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, awaitLastFut, cache, checkCurrentTx, checkJta, clear, clear, clearAll, clearAllAsync, clearAsync, clearAsync, clearLocally, clearLocally, clearLocally, clearLocallyAll, clusterMetrics, clusterMetrics, clusterMxBean, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, context, decrementSize, entries, entryEx, entryEx, entrySet, entrySet, evict, evictAll, expiry, expiryPolicy, forSubjectId, get, get, getAll, getAll, getAllAsync, getAllAsync, getAllAsync0, getAllOutTx, getAllOutTxAsync, getAndPut, getAndPut, getAndPut0, getAndPutAsync, getAndPutAsync, getAndPutAsync0, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove, getAndRemove0, getAndRemoveAsync, getAndRemoveAsync0, getAndReplace, getAndReplaceAsync, getAsync, getAsync, getEntries, getEntriesAsync, getEntry, getEntryAsync, getForcePrimary, getForcePrimaryAsync, igniteIterator, igniteIterator, incrementSize, init, invoke, invoke, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAsync, isColocated, isDht, isDhtAtomic, isEmpty, isLocal, isLocked, isLockedByThread, isNear, iterator, iterator, keepBinary, keySet, loadAll, localEntries, localLoadCacheAsync, localMetrics, localMxBean, localPeek, localPreloadPartition, localSize, lock, lockAll, lockAsync, log, lostPartitions, map, metrics0, name, nearSize, nextVersion, nextVersion, offHeapAllocatedSize, offHeapEntriesCount, onKernalStart, onReconnected, onUndeploy, parsePeekModes, peekEx, peekEx, preloadPartition, preloadPartitionAsync, put, put, put0, putAll, putAll0, putAllAsync, putAllAsync0, putAllConflict, putAllConflictAsync, putAsync, putAsync, putAsync0, putIfAbsent, putIfAbsentAsync, readExternal, readResolve, rebalance, remove, remove, remove, remove0, removeAll, removeAll0, removeAllAsync, removeAllAsync0, removeAllConflict, removeAllConflictAsync, removeAsync, removeAsync, removeAsync, removeAsync0, removeEntry, removeIfObsolete, removeMetrics, repairableGet, repairableGetAll, repairableGetAllAsync, repairableGetAsync, repairAsync, repairAsync, replace, replace, replaceAsync, replaceAsync, saveFuture, scanIterator, setSkipStore, size, sizeAsync, sizeLong, sizeLong, sizeLongAsync, sizeLongAsync, skipStore, startInfo, stop, stopInfo, tx, txStart, txStart, txStartEx, unlock, warnIfUnordered, warnIfUnordered, withAllowAtomicOpsInTx, withExpiryPolicy, withNoRetries, writeExternalclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected GridDhtCacheAdapter()
Externalizable.protected GridDhtCacheAdapter(GridCacheContext<K,V> ctx)
ctx - Context.protected GridDhtCacheAdapter(GridCacheContext<K,V> ctx, GridCacheConcurrentMap map)
ctx - Cache context.map - Cache map.public boolean addFuture(GridDhtForceKeysFuture<?,?> fut)
fut - Future to add.False if node cache is stopping and future was completed with error.public void removeFuture(GridDhtForceKeysFuture<?,?> fut)
fut - Future to remove.protected final void processForceKeyResponse(ClusterNode node, GridDhtForceKeysResponse msg)
node - Node.msg - Message.protected final void processForceKeysRequest(ClusterNode node, GridDhtForceKeysRequest msg)
node - Node originated request.msg - Force keys message.public void dumpDebugInfo()
public void onKernalStop()
onKernalStop in class GridCacheAdapter<K,V>protected final void processNearGetResponse(UUID nodeId, GridNearGetResponse res)
nodeId - Sender node ID.res - Near get response.protected void processNearSingleGetResponse(UUID nodeId, GridNearSingleGetResponse res)
nodeId - Sender node ID.res - Near get response.public void start()
throws IgniteCheckedException
start in class GridCacheAdapter<K,V>IgniteCheckedException - If start failed.public void printMemoryStats()
printMemoryStats in class GridCacheAdapter<K,V>public abstract GridNearCacheAdapter<K,V> near()
public GridDhtPartitionTopology topology()
public GridCachePreloader preloader()
preloader in class GridCacheAdapter<K,V>@Nullable public @Nullable GridDhtCacheEntry peekExx(KeyCacheObject key)
key - Key.public GridCacheEntryEx entryEx(KeyCacheObject key, AffinityTopologyVersion topVer) throws GridDhtInvalidPartitionException
entryEx in class GridCacheAdapter<K,V>key - Entry key.topVer - Topology version.null).GridDhtInvalidPartitionException - If partition for the key is no longer valid.public GridDhtCacheEntry entryExx(KeyCacheObject key) throws GridDhtInvalidPartitionException
key - Key.GridDhtInvalidPartitionException - If partition for the key is no longer valid.public GridDhtCacheEntry entryExx(KeyCacheObject key, AffinityTopologyVersion topVer) throws GridDhtInvalidPartitionException
key - Key.topVer - Topology version.GridDhtInvalidPartitionException - If partition for the key is no longer valid.protected GridDistributedCacheEntry createEntry(KeyCacheObject key)
key - Key for which entry should be returned.public void localLoad(Collection<? extends K> keys, javax.cache.expiry.ExpiryPolicy plc, boolean keepBinary) throws IgniteCheckedException
localLoad in class GridCacheAdapter<K,V>keys - Keys to load.plc - Optional expiry policy.IgniteCheckedException - If failed.public void localLoadCache(IgniteBiPredicate<K,V> p, Object[] args) throws IgniteCheckedException
CacheStore.loadCache(IgniteBiInClosure, Object...) method
to load state from the underlying persistent storage. The loaded values
will then be given to the optionally passed in predicate, and, if the predicate returns
true, will be stored in cache. If predicate is null, then
all loaded values will be stored in cache.
Note that this method does not receive keys as a parameter, so it is up to
CacheStore implementation to provide all the data to be loaded.
This method is not transactional and may end up loading a stale value into cache if another thread has updated the value immediately after it has been loaded. It is mostly useful when pre-loading the cache from underlying data store before start, or for read-only caches.
localLoadCache in interface IgniteInternalCache<K,V>localLoadCache in class GridCacheAdapter<K,V>p - Optional predicate (may be null). If provided, will be used to
filter values to be put into cache.args - Optional user arguments to be passed into
CacheStore.loadCache(IgniteBiInClosure, Object...) method.IgniteCheckedException - If loading failed.public int size()
IgniteInternalCache. It is essentially the
size of cache key set and is semantically identical to {Cache.keySet().size().
NOTE: this operation is not distributed and returns only the number of entries cached on this node.
size in interface IgniteInternalCache<K,V>size in class GridCacheAdapter<K,V>public long sizeLong()
IgniteInternalCache. It is essentially the
size of cache key set and is semantically identical to {Cache.keySet().size().
NOTE: this operation is not distributed and returns only the number of entries cached on this node.
sizeLong in interface IgniteInternalCache<K,V>sizeLong in class GridCacheAdapter<K,V>public int primarySize()
CacheMode.LOCAL non-distributed
cache mode, this method is identical to IgniteInternalCache.size().
For CacheMode.PARTITIONED and CacheMode.REPLICATED modes, this method will
return number of primary entries cached on this node (excluding any backups). The complexity of
this method is O(P), where P is the total number of partitions.
NOTE: this operation is not distributed and returns only the number of primary entries cached on this node.
primarySize in interface IgniteInternalCache<K,V>primarySize in class GridCacheAdapter<K,V>public long primarySizeLong()
CacheMode.LOCAL
non-distributed cache mode, this method is identical to IgniteInternalCache.size().
For CacheMode.PARTITIONED and CacheMode.REPLICATED modes, this method will
return number of primary entries cached on this node (excluding any backups). The complexity of
this method is O(P), where P is the total number of partitions.
NOTE: this operation is not distributed and returns only the number of primary entries cached on this node.
primarySizeLong in interface IgniteInternalCache<K,V>primarySizeLong in class GridCacheAdapter<K,V>public IgniteInternalFuture<Map<K,V>> getAllAsync(@Nullable @Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, @Nullable @Nullable UUID subjId, String taskName, boolean deserializeBinary, boolean recovery, boolean readRepair, boolean skipVals, boolean needVer)
getAllAsync in class GridCacheAdapter<K,V>keys - Keys.forcePrimary - Force primary.skipTx - Skip tx.subjId - Subj Id.taskName - Task name.deserializeBinary - Deserialize binary.recovery - Recovery mode flag.skipVals - Skip values.needVer - Need version.GridCacheAdapter.getAllAsync(Collection)public GridDhtFuture<Collection<GridCacheEntryInfo>> getDhtAsync(UUID reader, long msgId, Map<KeyCacheObject,Boolean> keys, boolean addReaders, boolean readThrough, AffinityTopologyVersion topVer, @Nullable @Nullable UUID subjId, int taskNameHash, @Nullable @Nullable IgniteCacheExpiryPolicy expiry, boolean skipVals, boolean recovery, @Nullable @Nullable String txLbl, MvccSnapshot mvccSnapshot)
reader - Reader node ID.msgId - Message ID.keys - Keys to get.addReaders - Add readers flag.readThrough - Read through flag.topVer - Topology version.subjId - Subject ID.taskNameHash - Task name hash code.expiry - Expiry policy.skipVals - Skip values flag.txLbl - Transaction label.mvccSnapshot - MVCC snapshot.protected void processNearSingleGetRequest(UUID nodeId, GridNearSingleGetRequest req)
nodeId - Node ID.req - Get request.protected void processNearGetRequest(UUID nodeId, GridNearGetRequest req)
nodeId - Node ID.req - Get request.public void sendTtlUpdateRequest(@Nullable
@Nullable IgniteCacheExpiryPolicy expiryPlc)
IgniteCacheExpiryPolicy.readers().expiryPlc - Expiry policy.public void unlockAll(Collection<? extends K> keys)
TransactionConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.keys - Keys to unlock.public String toString()
toString in class GridDistributedCacheAdapter<K,V>public List<GridCacheClearAllRunnable<K,V>> splitClearLocally(boolean srv, boolean near, boolean readers)
splitClearLocally in class GridCacheAdapter<K,V>srv - Whether to clear server cache.near - Whether to clear near cache.readers - Whether to clear readers.public void onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)
onDeferredDelete in class GridCacheAdapter<K,V>entry - Entry.ver - Version.protected final boolean needRemap(AffinityTopologyVersion mapVer, AffinityTopologyVersion curVer)
mapVer - Mapped topology version.curVer - Current topology version.True if cache affinity changed and operation should be remapped.public Iterator<javax.cache.Cache.Entry<K,V>> localEntriesIterator(boolean primary, boolean backup, boolean keepBinary)
primary - If true includes primary entries.backup - If true includes backup entries.keepBinary - Keep binary flag.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021