org.apache.ignite.internal.processors.cache.distributed.near

## Class GridNearCacheAdapter<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheAdapter<K,V>
  - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheAdapter<K,V>
    - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheAdapter<K,V>

All Implemented Interfaces:
  Externalizable, Serializable, Iterable<javax.cache.Cache.Entry<K,V>>, IgniteInternalCache<K,V>

Direct Known Subclasses:
  GridNearAtomicCache, GridNearTransactionalCache

    public abstract class GridNearCacheAdapter<K,V>
    extends GridDistributedCacheAdapter<K,V>

Common logic for near caches.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.ignite.internal.processors.cache.GridCacheAdapter

`GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.CacheExpiryPolicy, GridCacheAdapter.FutureHolder, GridCacheAdapter.TopologyVersionAwareJob, GridCacheAdapter.UpdateGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutAndGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveTimeStatClosure<T>, GridCacheAdapter.UpdateTimeStatClosure<T>`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheAdapter

`cacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, ctx, gridCfg, keyCheck, lastFut, locNodeId, log, map, MAX_RETRIES, metrics, mxBean, RET2NULL`

### Constructor Summary

Constructors
`protected` `GridNearCacheAdapter()` Empty constructor required for `Externalizable`.
`protected` `GridNearCacheAdapter(GridCacheContext<K,V> ctx)`

### Method Summary

Methods
`boolean` `clearLocally(K key)` Clears an entry from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction.
`void` `clearLocallyAll(Set<? extends K> keys, boolean srv, boolean near, boolean readers)` Clears entries from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction.
`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 forcePrimary, UUID subjId, String taskName, boolean deserializePortable, javax.cache.expiry.ExpiryPolicy expiryPlc, boolean skipVal, boolean skipStore, boolean canRemap)`
`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.
`void` `onReconnected()`
`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.
`long` `primarySizeLong()` Gets the number of all primary entries cached on this node as a long value.
`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()`
`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.
`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.

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheAdapter

`lockAllAsync, lockAllAsync, removeAll, removeAllAsync, removeVersionedEntry, txLockAsync`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheAdapter

`affinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, awaitLastFut, cache, checkJta, clear, clear, clearAll, clearAllAsync, clearAsync, clearAsync, clearLocally, clearLocally, 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, getAsync, getForcePrimary, getForcePrimaryAsync, getTopologySafe, igniteIterator, invoke, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAsync, isColocated, isDht, isDhtAtomic, isEmpty, isLocal, isLockedByThread, iterator, iterator, keepPortable, keySet, keySetx, keySetx, loadAll, localEntries, localPeek, localRemoveAll, localSize, localSizeLong, 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, remove, remove, removeAll, removeAllAsync, removeAllConflict, removeAllConflictAsync, removeAsync, removeAsync, removeAsync, removeEntry, removeIfObsolete, removex, removexAsync, replace, replace, replaceAsync, replaceAsync, replacex, replacexAsync, saveFuture, setSkipStore, size, sizeAsync, sizeLong, sizeLongAsync, skipStore, start, startInfo, stop, stopInfo, tryPutIfAbsent, tx, txStart, txStart, txStartEx, unlock, validateCacheKey, validateCacheKeys, values, withExpiryPolicy, writeExternal`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.ignite.internal.processors.cache.IgniteInternalCache

`unlockAll`

### Constructor Detail

#### GridNearCacheAdapter

    protected GridNearCacheAdapter()

Empty constructor required for `Externalizable`.

#### GridNearCacheAdapter

    protected GridNearCacheAdapter(GridCacheContext<K,V> ctx)

Parameters:
  `ctx` - Context.

### Method Detail

#### init

    protected void init()

Post constructor initialization for subclasses.

Overrides:
  `init` in class `GridCacheAdapter<K,V>`

#### dht

    public abstract GridDhtCacheAdapter<K,V> dht()

Returns:
  DHT cache.

#### onReconnected

    public void onReconnected()

Overrides:
  `onReconnected` in class `GridCacheAdapter<K,V>`

#### isNear

    public boolean isNear()

Overrides:
  `isNear` in class `GridCacheAdapter<K,V>`
Returns:
  `True` if this is near cache.

#### preloader

    public GridCachePreloader preloader()

Specified by:
  `preloader` in class `GridCacheAdapter<K,V>`
Returns:
  Preloader.

#### entryEx

    public GridCacheEntryEx entryEx(KeyCacheObject key,
                           boolean touch)

Overrides:
  `entryEx` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Entry key.
  `touch` - Whether created entry should be touched.
Returns:
  Entry (never `null`).

#### entryEx

    public GridCacheEntryEx entryEx(KeyCacheObject key,
                           AffinityTopologyVersion topVer)

Overrides:
  `entryEx` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Entry key.
  `topVer` - Topology version.
Returns:
  Entry (never `null`).

#### entryExx

    public GridNearCacheEntry entryExx(KeyCacheObject key,
                              AffinityTopologyVersion topVer)

Parameters:
  `key` - Key.
  `topVer` - Topology version.
Returns:
  Entry.

#### peekExx

    @Nullable
    public GridNearCacheEntry peekExx(KeyCacheObject key)

Parameters:
  `key` - Key.
Returns:
  Entry.

#### isLocked

    public boolean isLocked(K key)

Checks if any node owns a lock for this key.

This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.

Specified by:
  `isLocked` in interface `IgniteInternalCache<K,V>`
Overrides:
  `isLocked` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key to check.
Returns:
  `True` if lock is owned by some node.

#### isLockedNearOnly

    public boolean isLockedNearOnly(K key)

Parameters:
  `key` - Key.
Returns:
  If near entry is locked.

#### isAllLockedNearOnly

    public boolean isAllLockedNearOnly(Iterable<? extends K> keys)

Parameters:
  `keys` - Keys.
Returns:
  If near entries for given keys are locked.

#### loadAsync

    public IgniteInternalFuture<Map<K,V>> loadAsync(@Nullable
                                           IgniteInternalTx tx,
                                           @Nullable
                                           Collection<KeyCacheObject> keys,
                                           boolean forcePrimary,
                                           @Nullable
                                           UUID subjId,
                                           String taskName,
                                           boolean deserializePortable,
                                           @Nullable
                                           javax.cache.expiry.ExpiryPolicy expiryPlc,
                                           boolean skipVal,
                                           boolean skipStore,
                                           boolean canRemap)

Parameters:
  `tx` - Transaction.
  `keys` - Keys to load.
  `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.
  `canRemap` - Can remap flag.
Returns:
  Loaded values.

#### localLoadCache

    public void localLoadCache(IgniteBiPredicate<K,V> p,
                      Object[] args)
                        throws IgniteCheckedException

Delegates to `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.

Specified by:
  `localLoadCache` in interface `IgniteInternalCache<K,V>`
Overrides:
  `localLoadCache` in class `GridCacheAdapter<K,V>`
Parameters:
  `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.
Throws:
  `IgniteCheckedException` - If loading failed.

#### localLoad

    public void localLoad(Collection<? extends K> keys,
                 javax.cache.expiry.ExpiryPolicy plc)
                   throws IgniteCheckedException

Overrides:
  `localLoad` in class `GridCacheAdapter<K,V>`
Parameters:
  `keys` - Keys to load.
  `plc` - Optional expiry policy.
Throws:
  `IgniteCheckedException` - If failed.

#### localLoadCacheAsync

    public 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. 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.

Specified by:
  `localLoadCacheAsync` in interface `IgniteInternalCache<K,V>`
Overrides:
  `localLoadCacheAsync` in class `GridCacheAdapter<K,V>`
Parameters:
  `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.
Returns:
  Future to be completed whenever loading completes.

#### processGetResponse

    protected void processGetResponse(UUID nodeId,
                          GridNearGetResponse res)

Parameters:
  `nodeId` - Sender ID.
  `res` - Response.

#### size

    public int size()

Gets the number of all entries cached on this node. This method will return the count of all cache entries and has O(1) complexity on base `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.

Specified by:
  `size` in interface `IgniteInternalCache<K,V>`
Overrides:
  `size` in class `GridCacheAdapter<K,V>`
Returns:
  Size of cache on this node.

#### sizeLong

    public long sizeLong()

Gets the number of all entries cached on this node as a long value. This method will return the count of all cache entries and has O(1) complexity on base `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.

Specified by:
  `sizeLong` in interface `IgniteInternalCache<K,V>`
Overrides:
  `sizeLong` in class `GridCacheAdapter<K,V>`
Returns:
  Size of cache on this node.

#### primarySize

    public int primarySize()

Gets the number of all primary entries cached on this node. For `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.

Specified by:
  `primarySize` in interface `IgniteInternalCache<K,V>`
Overrides:
  `primarySize` in class `GridCacheAdapter<K,V>`
Returns:
  Number of primary entries in cache.

#### primarySizeLong

    public long primarySizeLong()

Gets the number of all primary entries cached on this node as a long value. For `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.

Specified by:
  `primarySizeLong` in interface `IgniteInternalCache<K,V>`
Overrides:
  `primarySizeLong` in class `GridCacheAdapter<K,V>`
Returns:
  Number of primary entries in cache.

#### nearSize

    public int nearSize()

Gets size of near cache key set. This method will return count of all entries in near cache and has O(1) complexity on base cache projection.

Note that for `LOCAL` non-distributed caches this method will always return `0`

Specified by:
  `nearSize` in interface `IgniteInternalCache<K,V>`
Overrides:
  `nearSize` in class `GridCacheAdapter<K,V>`
Returns:
  Size of near cache key set or `0` if cache is not `CacheMode.PARTITIONED`.

#### nearEntries

    public Set<javax.cache.Cache.Entry<K,V>> nearEntries()

Returns:
  Near entries.

#### entrySet

    public Set<javax.cache.Cache.Entry<K,V>> entrySet(@Nullable
                                             CacheEntryPredicate... filter)

Overrides:
  `entrySet` in class `GridCacheAdapter<K,V>`
Parameters:
  `filter` - Filters to evaluate.
Returns:
  Entry set.

#### entrySet

    public 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.

NOTE: this operation is not distributed and returns only the entries cached on this node.

Specified by:
  `entrySet` in interface `IgniteInternalCache<K,V>`
Overrides:
  `entrySet` in class `GridCacheAdapter<K,V>`
Parameters:
  `part` - Partition.
Returns:
  Set containing partition's entries or `null` if partition is not found locally.

#### primaryEntrySet

    public Set<javax.cache.Cache.Entry<K,V>> primaryEntrySet(@Nullable
                                                    CacheEntryPredicate... filter)

Overrides:
  `primaryEntrySet` in class `GridCacheAdapter<K,V>`
Parameters:
  `filter` - Filters to evaluate.
Returns:
  Primary entry set.

#### keySet

    public Set<K> keySet(@Nullable
                CacheEntryPredicate[] filter)

Overrides:
  `keySet` in class `GridCacheAdapter<K,V>`
Parameters:
  `filter` - Filters to evaluate.
Returns:
  Key set.

#### nearKeySet

    public Set<K> nearKeySet(@Nullable
                    CacheEntryPredicate filter)

Parameters:
  `filter` - Entry filter.
Returns:
  Keys for near cache only.

#### primaryKeySet

    public Set<K> primaryKeySet(@Nullable
                       CacheEntryPredicate... filter)

Overrides:
  `primaryKeySet` in class `GridCacheAdapter<K,V>`
Parameters:
  `filter` - Primary key set.
Returns:
  Primary key set.

#### values

    public Collection<V> values(CacheEntryPredicate... filter)

Collection of values cached on this node. You can remove elements from this collection, but you cannot add elements to this collection. All removal operation will be reflected on the cache itself.

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.

Overrides:
  `values` in class `GridCacheAdapter<K,V>`
Parameters:
  `filter` - Filters.
Returns:
  Collection of cached values.

#### evict

    public boolean evict(K key)

Evicts entry associated with given key from cache. Note, that entry will be evicted only if it's not used (not participating in any locks or transactions).

If `CacheConfiguration.isSwapEnabled()` is set to `true`, the evicted entry will be swapped to offheap, and then to disk.

Specified by:
  `evict` in interface `IgniteInternalCache<K,V>`
Overrides:
  `evict` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key to evict from cache.
Returns:
  `True` if entry could be evicted, `false` otherwise.

#### evictAll

    public void evictAll(Collection<? extends K> keys)

Attempts to evict all entries associated with keys. Note, that entry will be evicted only if it's not used (not participating in any locks or transactions).

If `CacheConfiguration.isSwapEnabled()` is set to `true`, the evicted entry will be swapped to offheap, and then to disk.

Specified by:
  `evictAll` in interface `IgniteInternalCache<K,V>`
Overrides:
  `evictAll` in class `GridCacheAdapter<K,V>`
Parameters:
  `keys` - Keys to evict.

#### clearLocally

    public boolean clearLocally(K key)

Clears an entry from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction.

If `CacheConfiguration.isSwapEnabled()` is set to `true`, the evicted entries will also be cleared from swap.

Note that this operation is local as it merely clears an entry from local cache. It does not remove entries from remote caches or from underlying persistent storage.

Specified by:
  `clearLocally` in interface `IgniteInternalCache<K,V>`
Overrides:
  `clearLocally` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key to clearLocally.
Returns:
  `True` if entry was successfully cleared from cache, `false` if entry was in use at the time of this method invocation and could not be cleared.

#### clearLocallyAll

    public void clearLocallyAll(Set<? extends K> keys,
                       boolean srv,
                       boolean near,
                       boolean readers)

Clears entries from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction.

If `CacheConfiguration.isSwapEnabled()` is set to `true`, the evicted entries will also be cleared from swap.

Note that this operation is local as it merely clears an entry from local cache. It does not remove entries from remote caches or from underlying persistent storage.

Specified by:
  `clearLocallyAll` in interface `IgniteInternalCache<K,V>`
Overrides:
  `clearLocallyAll` in class `GridCacheAdapter<K,V>`
Parameters:
  `keys` - Keys to clearLocally.
  `srv` - Whether to clear server cache.
  `near` - Whether to clear near cache.
  `readers` - Whether to clear readers.

#### promote

    public V promote(K key,
            boolean deserializePortable)
              throws IgniteCheckedException

Overrides:
  `promote` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key.
  `deserializePortable` - Deserialize portable flag.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### promoteAll

    public void promoteAll(@Nullable
                  Collection<? extends K> keys)
                    throws IgniteCheckedException

This method unswaps cache entries by given keys, if any, from swap storage into memory.

## Transactions

This method is not transactional.

Specified by:
  `promoteAll` in interface `IgniteInternalCache<K,V>`
Overrides:
  `promoteAll` in class `GridCacheAdapter<K,V>`
Parameters:
  `keys` - Keys to promote entries for.
Throws:
  `IgniteCheckedException` - If promote failed.

#### randomEntry

    @Nullable
    public javax.cache.Cache.Entry<K,V> randomEntry()

Overrides:
  `randomEntry` in class `GridCacheAdapter<K,V>`
Returns:
  Random cache entry.

#### offHeapEntriesCount

    public long offHeapEntriesCount()

Gets number of cache entries stored in off-heap memory.

Specified by:
  `offHeapEntriesCount` in interface `IgniteInternalCache<K,V>`
Overrides:
  `offHeapEntriesCount` in class `GridCacheAdapter<K,V>`
Returns:
  Number of cache entries stored in off-heap memory.

#### offHeapAllocatedSize

    public long offHeapAllocatedSize()

Gets memory size allocated in off-heap.

Specified by:
  `offHeapAllocatedSize` in interface `IgniteInternalCache<K,V>`
Overrides:
  `offHeapAllocatedSize` in class `GridCacheAdapter<K,V>`
Returns:
  Allocated memory size.

#### swapSize

    public long swapSize()
                  throws IgniteCheckedException

Gets size in bytes for swap space.

Specified by:
  `swapSize` in interface `IgniteInternalCache<K,V>`
Overrides:
  `swapSize` in class `GridCacheAdapter<K,V>`
Returns:
  Size in bytes.
Throws:
  `IgniteCheckedException` - If failed.

#### swapKeys

    public long swapKeys()
                  throws IgniteCheckedException

Gets number of swap entries (keys).

Specified by:
  `swapKeys` in interface `IgniteInternalCache<K,V>`
Overrides:
  `swapKeys` in class `GridCacheAdapter<K,V>`
Returns:
  Number of entries stored in swap.
Throws:
  `IgniteCheckedException` - If failed.

#### isIgfsDataCache

    public boolean isIgfsDataCache()

Checks whether this cache is IGFS data cache.

Specified by:
  `isIgfsDataCache` in interface `IgniteInternalCache<K,V>`
Overrides:
  `isIgfsDataCache` in class `GridCacheAdapter<K,V>`
Returns:
  `True` in case this cache is IGFS data cache.

#### igfsDataSpaceUsed

    public long igfsDataSpaceUsed()

Get current amount of used IGFS space in bytes.

Specified by:
  `igfsDataSpaceUsed` in interface `IgniteInternalCache<K,V>`
Overrides:
  `igfsDataSpaceUsed` in class `GridCacheAdapter<K,V>`
Returns:
  Amount of used IGFS space in bytes.

#### igfsDataSpaceMax

    public long igfsDataSpaceMax()

Get maximum space available for IGFS.

Specified by:
  `igfsDataSpaceMax` in interface `IgniteInternalCache<K,V>`
Overrides:
  `igfsDataSpaceMax` in class `GridCacheAdapter<K,V>`
Returns:
  Amount of space available for IGFS in bytes.

#### onIgfsDataSizeChanged

    public void onIgfsDataSizeChanged(long delta)

Callback invoked when data is added to IGFS cache.

Overrides:
  `onIgfsDataSizeChanged` in class `GridCacheAdapter<K,V>`
Parameters:
  `delta` - Size delta.

#### isMongoDataCache

    public boolean isMongoDataCache()

Checks whether this cache is Mongo data cache.

Specified by:
  `isMongoDataCache` in interface `IgniteInternalCache<K,V>`
Overrides:
  `isMongoDataCache` in class `GridCacheAdapter<K,V>`
Returns:
  `True` if this cache is mongo data cache.

#### isMongoMetaCache

    public boolean isMongoMetaCache()

Checks whether this cache is Mongo meta cache.

Specified by:
  `isMongoMetaCache` in interface `IgniteInternalCache<K,V>`
Overrides:
  `isMongoMetaCache` in class `GridCacheAdapter<K,V>`
Returns:
  `True` if this cache is mongo meta cache.

#### splitClearLocally

    public List<GridCacheClearAllRunnable<K,V>> splitClearLocally(boolean srv,
                                                         boolean near,
                                                         boolean readers)

Split clearLocally all task into multiple runnables.

Overrides:
  `splitClearLocally` in class `GridCacheAdapter<K,V>`
Parameters:
  `srv` - Whether to clear server cache.
  `near` - Whether to clear near cache.
  `readers` - Whether to clear readers.
Returns:
  Split runnables.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDistributedCacheAdapter<K,V>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0-b1
Release Date | : December 1 2015