public abstract class GridNearCacheAdapter<K,V> extends GridDistributedCacheAdapter<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>| Modifier | Constructor and Description |
|---|---|
protected |
GridNearCacheAdapter()
Empty constructor required for
Externalizable. |
protected |
GridNearCacheAdapter(GridCacheContext<K,V> ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearLocally0(Collection<? extends K> keys,
CacheEntryPredicate[] filter) |
boolean |
clearLocally0(K key,
CacheEntryPredicate[] filter) |
abstract GridDhtCacheAdapter<K,V> |
dht() |
GridCacheEntryEx |
entryEx(KeyCacheObject key,
AffinityTopologyVersion topVer) |
GridCacheEntryEx |
entryEx(KeyCacheObject key,
boolean touch) |
GridNearCacheEntry |
entryExx(KeyCacheObject key,
AffinityTopologyVersion topVer) |
Set<javax.cache.Cache.Entry<K,V>> |
entrySet(CacheEntryPredicate... filter) |
Set<javax.cache.Cache.Entry<K,V>> |
entrySet(int part)
Gets set containing cache entries that belong to provided partition or
null
if partition is not found locally. |
boolean |
evict(K key)
Evicts entry associated with given key from cache.
|
void |
evictAll(Collection<? extends K> keys)
Attempts to evict all entries associated with keys.
|
long |
igfsDataSpaceMax()
Get maximum space available for IGFS.
|
long |
igfsDataSpaceUsed()
Get current amount of used IGFS space in bytes.
|
protected void |
init()
Post constructor initialization for subclasses.
|
boolean |
isAllLockedNearOnly(Iterable<? extends K> keys) |
boolean |
isIgfsDataCache()
Checks whether this cache is IGFS data cache.
|
boolean |
isLocked(K key)
Checks if any node owns a lock for this key.
|
boolean |
isLockedNearOnly(K key) |
boolean |
isMongoDataCache()
Checks whether this cache is Mongo data cache.
|
boolean |
isMongoMetaCache()
Checks whether this cache is Mongo meta cache.
|
boolean |
isNear() |
Set<K> |
keySet(CacheEntryPredicate[] filter) |
IgniteInternalFuture<Map<K,V>> |
loadAsync(IgniteInternalTx tx,
Collection<KeyCacheObject> keys,
boolean reload,
boolean forcePrimary,
UUID subjId,
String taskName,
boolean deserializePortable,
javax.cache.expiry.ExpiryPolicy expiryPlc,
boolean skipVal,
boolean skipStore) |
void |
localLoad(Collection<? extends K> keys,
javax.cache.expiry.ExpiryPolicy plc) |
void |
localLoadCache(IgniteBiPredicate<K,V> p,
Object[] args)
Delegates to
CacheStore.loadCache(org.apache.ignite.lang.IgniteBiInClosure,Object...) method
to load state from the underlying persistent storage. |
IgniteInternalFuture<?> |
localLoadCacheAsync(IgniteBiPredicate<K,V> p,
Object[] args)
Asynchronously delegates to
CacheStore.loadCache(org.apache.ignite.lang.IgniteBiInClosure, Object...) method
to reload state from the underlying persistent storage. |
Set<javax.cache.Cache.Entry<K,V>> |
nearEntries() |
Set<K> |
nearKeySet(CacheEntryPredicate filter) |
int |
nearSize()
Gets size of near cache key set.
|
long |
offHeapAllocatedSize()
Gets memory size allocated in off-heap.
|
long |
offHeapEntriesCount()
Gets number of cache entries stored in off-heap memory.
|
void |
onIgfsDataSizeChanged(long delta)
Callback invoked when data is added to IGFS cache.
|
GridNearCacheEntry |
peekExx(KeyCacheObject key) |
GridCachePreloader |
preloader() |
Set<javax.cache.Cache.Entry<K,V>> |
primaryEntrySet(CacheEntryPredicate... filter) |
Set<K> |
primaryKeySet(CacheEntryPredicate... filter) |
int |
primarySize()
Gets the number of all primary entries cached on this node.
|
protected void |
processGetResponse(UUID nodeId,
GridNearGetResponse res) |
V |
promote(K key,
boolean deserializePortable) |
void |
promoteAll(Collection<? extends K> keys)
This method unswaps cache entries by given keys, if any, from swap storage
into memory.
|
javax.cache.Cache.Entry<K,V> |
randomEntry() |
IgniteInternalFuture<Object> |
readThroughAllAsync(Collection<KeyCacheObject> keys,
boolean reload,
boolean skipVals,
IgniteInternalTx tx,
UUID subjId,
String taskName,
IgniteBiInClosure<KeyCacheObject,Object> vis) |
int |
size()
Gets the number of all entries cached on this node.
|
List<GridCacheClearAllRunnable<K,V>> |
splitClearLocally()
Split clearLocally all task into multiple runnables.
|
long |
swapKeys()
Gets number of swap entries (keys).
|
long |
swapSize()
Gets size in bytes for swap space.
|
String |
toString() |
Collection<V> |
values(CacheEntryPredicate... filter)
Collection of values cached on this node.
|
lockAllAsync, lockAllAsync, removeAll, removeAllAsync, removeVersionedEntry, txLockAsyncaffinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, awaitLastFut, cache, checkJta, clear, clear, clearAll, clearAsync, clearAsync, clearAsync, clearLocally, clearLocally, clearLocally, clearLocallyAll, commitTxAsync, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, context, entries, entryEx, entryEx, entryExSafe, entrySet, entrySetx, expiry, expiryPolicy, forSubjectId, get, get, getAll, getAll, getAllAsync, getAllAsync, getAllAsync, getAllAsync, getAllAsync0, getAllOutTx, getAllOutTxAsync, getAndPut, getAndPut, getAndPutAsync, getAndPutAsync, getAndPutAsync0, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove, getAndRemoveAsync, getAndReplace, getAndReplaceAsync, getAsync, getAsync, getForcePrimary, getForcePrimaryAsync, igniteIterator, invoke, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAsync, isColocated, isDht, isDhtAtomic, isEmpty, isLocal, isLockedByThread, iterator, iterator, keepPortable, keySet, keySetx, keySetx, loadAll, localEntries, localPeek, localRemoveAll, localSize, lock, lockAll, lockAsync, log, map, metrics, metrics0, mxBean, name, onDeferredDelete, onKernalStart, onKernalStop, onUndeploy, overflowSize, peekEx, peekEx, primaryKeySet, printMemoryStats, put, put, putAll, putAllAsync, putAllConflict, putAllConflictAsync, putAsync, putAsync, putAsync0, putIfAbsent, putIfAbsentAsync, readExternal, readResolve, rebalance, reloadAllAsync0, remove, remove, removeAll, removeAllAsync, removeAllConflict, removeAllConflictAsync, removeAsync, removeAsync, removeAsync, removeEntry, removeIfObsolete, removex, removexAsync, replace, replace, replaceAsync, replaceAsync, replacex, replacexAsync, saveFuture, setSkipStore, size, sizeAsync, skipStore, start, startInfo, stop, stopInfo, tryPutIfAbsent, tx, txStart, txStart, txStartEx, unlock, validateCacheKey, validateCacheKeys, values, withExpiryPolicy, writeExternalclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitunlockAllprotected GridNearCacheAdapter()
Externalizable.protected GridNearCacheAdapter(GridCacheContext<K,V> ctx)
ctx - Context.protected void init()
init in class GridCacheAdapter<K,V>public abstract GridDhtCacheAdapter<K,V> dht()
public boolean isNear()
isNear in class GridCacheAdapter<K,V>True if this is near cache.public GridCachePreloader preloader()
preloader in class GridCacheAdapter<K,V>public GridCacheEntryEx entryEx(KeyCacheObject key, boolean touch)
entryEx in class GridCacheAdapter<K,V>key - Entry key.touch - Whether created entry should be touched.null).public GridCacheEntryEx entryEx(KeyCacheObject key, AffinityTopologyVersion topVer)
entryEx in class GridCacheAdapter<K,V>key - Entry key.topVer - Topology version.null).public GridNearCacheEntry entryExx(KeyCacheObject key, AffinityTopologyVersion topVer)
key - Key.topVer - Topology version.@Nullable public GridNearCacheEntry peekExx(KeyCacheObject key)
key - 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 isLockedNearOnly(K key)
key - Key.public boolean isAllLockedNearOnly(Iterable<? extends K> keys)
keys - Keys.public IgniteInternalFuture<Object> readThroughAllAsync(Collection<KeyCacheObject> keys, boolean reload, boolean skipVals, IgniteInternalTx tx, @Nullable UUID subjId, String taskName, IgniteBiInClosure<KeyCacheObject,Object> vis)
readThroughAllAsync in class GridCacheAdapter<K,V>keys - Keys.reload - Reload flag.tx - Transaction.subjId - Subject ID.taskName - Task name.vis - Visitor.public IgniteInternalFuture<Map<K,V>> loadAsync(@Nullable IgniteInternalTx tx, @Nullable Collection<KeyCacheObject> keys, boolean reload, boolean forcePrimary, @Nullable UUID subjId, String taskName, boolean deserializePortable, @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc, boolean skipVal, boolean skipStore)
tx - Transaction.keys - Keys to load.reload - Reload flag.forcePrimary - Force primary flag.subjId - Subject ID.taskName - Task name.deserializePortable - Deserialize portable flag.expiryPlc - Expiry policy.skipVal - Skip value flag.skipStore - Skip store flag.public void localLoadCache(IgniteBiPredicate<K,V> p, Object[] args) throws IgniteCheckedException
CacheStore.loadCache(org.apache.ignite.lang.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(org.apache.ignite.lang.IgniteBiInClosure, Object...) method.IgniteCheckedException - If loading failed.public void localLoad(Collection<? extends K> keys, javax.cache.expiry.ExpiryPolicy plc) throws IgniteCheckedException
localLoad in class GridCacheAdapter<K,V>keys - Keys to load.plc - Optional expiry policy.IgniteCheckedException - If failed.public IgniteInternalFuture<?> localLoadCacheAsync(IgniteBiPredicate<K,V> p, Object[] args)
CacheStore.loadCache(org.apache.ignite.lang.IgniteBiInClosure, Object...) method
to reload state from the underlying persistent storage. The reloaded 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 reloaded 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.
localLoadCacheAsync in interface IgniteInternalCache<K,V>localLoadCacheAsync 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(org.apache.ignite.lang.IgniteBiInClosure,Object...) method.protected void processGetResponse(UUID nodeId, GridNearGetResponse res)
nodeId - Sender ID.res - Response.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 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 int nearSize()
Note that for LOCAL non-distributed caches this method will always return 0
nearSize in interface IgniteInternalCache<K,V>nearSize in class GridCacheAdapter<K,V>0 if cache is not CacheMode.PARTITIONED.public Set<javax.cache.Cache.Entry<K,V>> entrySet(@Nullable CacheEntryPredicate... filter)
entrySet in class GridCacheAdapter<K,V>filter - Filters to evaluate.public Set<javax.cache.Cache.Entry<K,V>> entrySet(int part)
null
if partition is not found locally.
NOTE: this operation is not distributed and returns only the entries cached on this node.
entrySet in interface IgniteInternalCache<K,V>entrySet in class GridCacheAdapter<K,V>part - Partition.null if partition is
not found locally.public Set<javax.cache.Cache.Entry<K,V>> primaryEntrySet(@Nullable CacheEntryPredicate... filter)
primaryEntrySet in class GridCacheAdapter<K,V>filter - Filters to evaluate.public Set<K> keySet(@Nullable CacheEntryPredicate[] filter)
keySet in class GridCacheAdapter<K,V>filter - Filters to evaluate.public Set<K> nearKeySet(@Nullable CacheEntryPredicate filter)
filter - Entry filter.public Set<K> primaryKeySet(@Nullable CacheEntryPredicate... filter)
primaryKeySet in class GridCacheAdapter<K,V>filter - Primary key set.public Collection<V> values(CacheEntryPredicate... filter)
Iterator over this collection will not fail if collection was concurrently updated by another thread. This means that iterator may or may not return latest values depending on whether they were added before or after current iterator position.
NOTE: this operation is not distributed and returns only the values cached on this node.
values in class GridCacheAdapter<K,V>filter - Filters.public boolean evict(K key)
If CacheConfiguration.isSwapEnabled() is set to true, the evicted entry will
be swapped to offheap, and then to disk.
evict in interface IgniteInternalCache<K,V>evict in class GridCacheAdapter<K,V>key - Key to evict from cache.True if entry could be evicted, false otherwise.public void evictAll(Collection<? extends K> keys)
If CacheConfiguration.isSwapEnabled() is set to true, the evicted entry will
be swapped to offheap, and then to disk.
evictAll in interface IgniteInternalCache<K,V>evictAll in class GridCacheAdapter<K,V>keys - Keys to evict.public boolean clearLocally0(K key, @Nullable CacheEntryPredicate[] filter)
clearLocally0 in class GridCacheAdapter<K,V>key - Key.filter - Filters to evaluate.True if cleared.public void clearLocally0(Collection<? extends K> keys, @Nullable CacheEntryPredicate[] filter)
clearLocally0 in class GridCacheAdapter<K,V>keys - Keys.filter - Filters to evaluate.public V promote(K key, boolean deserializePortable) throws IgniteCheckedException
promote in class GridCacheAdapter<K,V>key - Key.deserializePortable - Deserialize portable flag.IgniteCheckedException - If failed.public void promoteAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException
promoteAll in interface IgniteInternalCache<K,V>promoteAll in class GridCacheAdapter<K,V>keys - Keys to promote entries for.IgniteCheckedException - If promote failed.@Nullable public javax.cache.Cache.Entry<K,V> randomEntry()
randomEntry in class GridCacheAdapter<K,V>public long offHeapEntriesCount()
offHeapEntriesCount in interface IgniteInternalCache<K,V>offHeapEntriesCount in class GridCacheAdapter<K,V>public long offHeapAllocatedSize()
offHeapAllocatedSize in interface IgniteInternalCache<K,V>offHeapAllocatedSize in class GridCacheAdapter<K,V>public long swapSize()
throws IgniteCheckedException
swapSize in interface IgniteInternalCache<K,V>swapSize in class GridCacheAdapter<K,V>IgniteCheckedException - If failed.public long swapKeys()
throws IgniteCheckedException
swapKeys in interface IgniteInternalCache<K,V>swapKeys in class GridCacheAdapter<K,V>IgniteCheckedException - If failed.public boolean isIgfsDataCache()
isIgfsDataCache in interface IgniteInternalCache<K,V>isIgfsDataCache in class GridCacheAdapter<K,V>True in case this cache is IGFS data cache.public long igfsDataSpaceUsed()
igfsDataSpaceUsed in interface IgniteInternalCache<K,V>igfsDataSpaceUsed in class GridCacheAdapter<K,V>public long igfsDataSpaceMax()
igfsDataSpaceMax in interface IgniteInternalCache<K,V>igfsDataSpaceMax in class GridCacheAdapter<K,V>public void onIgfsDataSizeChanged(long delta)
onIgfsDataSizeChanged in class GridCacheAdapter<K,V>delta - Size delta.public boolean isMongoDataCache()
isMongoDataCache in interface IgniteInternalCache<K,V>isMongoDataCache in class GridCacheAdapter<K,V>True if this cache is mongo data cache.public boolean isMongoMetaCache()
isMongoMetaCache in interface IgniteInternalCache<K,V>isMongoMetaCache in class GridCacheAdapter<K,V>True if this cache is mongo meta cache.public List<GridCacheClearAllRunnable<K,V>> splitClearLocally()
splitClearLocally in class GridCacheAdapter<K,V>public String toString()
toString in class GridDistributedCacheAdapter<K,V>
Follow @ApacheIgnite
Ignite Fabric : ver. 1.2.0-incubating Release Date : June 16 2015