org.apache.ignite.internal.processors.cache

## Interface IgniteInternalCache<K,V>

All Superinterfaces:
  Iterable<javax.cache.Cache.Entry<K,V>>

All Known Implementing Classes:
  GridCacheAdapter, GridCacheProxyImpl, GridDhtAtomicCache, GridDhtCache, GridDhtCacheAdapter, GridDhtColocatedCache, GridDhtTransactionalCacheAdapter, GridDistributedCacheAdapter, GridLocalAtomicCache, GridLocalCache, GridNearAtomicCache, GridNearCacheAdapter, GridNearTransactionalCache

    public interface IgniteInternalCache<K,V>
    extends Iterable<javax.cache.Cache.Entry<K,V>>

This interface provides a rich API for working with distributed caches. It includes the following main functionality:

- Various `'get(..)'` methods to synchronously or asynchronously get values from cache. All `'get(..)'` methods are transactional and will participate in an ongoing transaction if there is one.
- Various `'put(..)'`, `'putIfAbsent(..)'`, and `'replace(..)'` methods to synchronously or asynchronously put single or multiple entries into cache. All these methods are transactional and will participate in an ongoing transaction if there is one.
- Various `'remove(..)'` methods to synchronously or asynchronously remove single or multiple keys from cache. All `'remove(..)'` methods are transactional and will participate in an ongoing transaction if there is one.
- Various `'contains(..)'` method to check if cache contains certain keys or values locally.
- Various `'forEach(..)'`, `'forAny(..)'`, and `'reduce(..)'` methods to visit every local cache entry within this projection.
- Various `flagsOn(..)'`, `'flagsOff(..)'`, and `'projection(..)'` methods to set specific flags and filters on a cache projection.
- Methods like `'keySet(..)'`, `'values(..)'`, and `'entrySet(..)'` to provide views on cache keys, values, and entries.
- Various `'peek(..)'` methods to peek at values in global or transactional memory, swap storage, or persistent storage.
- Various `'reload(..)'` methods to reload latest values from persistent storage.
- Various `'promote(..)'` methods to load specified keys from swap storage into global cache memory.
- Various `'lock(..)'`, `'unlock(..)'`, and `'isLocked(..)'` methods to acquire, release, and check on distributed locks on a single or multiple keys in cache. All locking methods are not transactional and will not enlist keys into ongoing transaction, if any.
- Various `'clear(..)'` methods to clear elements from cache, and optionally from swap storage. All `'clear(..)'` methods are not transactional and will not enlist cleared keys into ongoing transaction, if any.
- Various `'evict(..)'` methods to evict elements from cache, and optionally store them in underlying swap storage for later access. All `'evict(..)'` methods are not transactional and will not enlist evicted keys into ongoing transaction, if any.
- Various `'txStart(..)'` methods to perform various cache operations within a transaction (see `Transaction` for more information).
- Various `'gridProjection(..)'` methods which provide `ClusterGroup` only for nodes on which given keys reside. All `'gridProjection(..)'` methods are not transactional and will not enlist keys into ongoing transaction.

# Extended Put And Remove Methods

All methods that end with `'x'` provide the same functionality as their sibling methods that don't end with `'x'`, however instead of returning a previous value they return a `boolean` flag indicating whether operation succeeded or not. Returning a previous value may involve a network trip or a persistent store lookup and should be avoided whenever not needed.

# Predicate Filters

All filters passed into methods on this API are checked atomically. In other words the value returned by the methods is guaranteed to be consistent with the filters passed in. Note that filters are optional, and if not passed in, then methods will still work as is without filter validation.

# Transactions

Cache API supports distributed transactions. All `'get(..)'`, `'put(..)'`, `'replace(..)'`, and `'remove(..)'` operations are transactional and will participate in an ongoing transaction, if any. Other methods like `'peek(..)'` or various `'contains(..)'` methods may be transaction-aware, i.e. check in-transaction entries first, but will not affect the current state of transaction. See `Transaction` documentation for more information about transactions.

# Group Locking

Group Locking is a feature where instead of acquiring individual locks, Ignite will lock multiple keys with one lock to save on locking overhead. There are 2 types of Group Locking: affinity-based, and partitioned-based.

With `affinity-based-group-locking` the keys are grouped by affinity-key. This means that only keys with identical affinity-key (see `AffinityKeyMapped`) can participate in the transaction, and only one lock on the affinity-key will be acquired for the whole transaction. `Affinity-group-locked` transactions are started via `txStartAffinity(Object, TransactionConcurrency, TransactionIsolation, long, int)` method.

With `partition-based-group-locking` the keys are grouped by partition ID. This means that only keys belonging to identical partition (see `Affinity.partition(Object)`) can participate in the transaction, and only one lock on the whole partition will be acquired for the whole transaction. `Partition-group-locked` transactions are started via `txStartPartition(int, TransactionConcurrency, TransactionIsolation, long, int)` method.

Group locking should always be used for transactions whenever possible. If your requirements fit either affinity-based or partition-based scenarios outlined above then group-locking can significantly improve performance of your application, often by an order of magnitude.

# Null Keys or Values

Neither `null` keys or values are allowed to be stored in cache. If a `null` value happens to be in cache (e.g. after invalidation or remove), then cache will treat this case as there is no value at all.

# Peer Class Loading

If peer-class-loading is enabled, all classes passed into cache API will be automatically deployed to any participating grid nodes. However, in case of redeployment, caches will be cleared and all entries will be removed. This behavior is useful during development, but should not be used in production.

# Binary Objects

If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) format. User can choose to work either with the binary format or with the deserialized form (assuming that class definitions are present in the classpath). By default, cache works with deserialized form (example shows the case when `Integer` is used as a key for a binary object):

     IgniteInternalCache<Integer, Value> prj = Ignition.grid().cache(null);

     // Value will be serialized and stored in cache in binary format.
     prj.put(1, new Value());

     // Value will be deserialized since it's stored in binary format.
     Value val = prj.get(1);

You won't be able to work with deserialized form if class definition for the `Value` is not on classpath. Even if you have the class definition, you should always avoid full deserialization if it's not needed for performance reasons. To work with binary format directly you should create special projection using `keepBinary()` method:

     IgniteInternalCache<Integer, GridBinaryObject> prj = Ignition.grid().cache(null).keepBinary();

     // Value is not deserialized and returned in binary format.
     GridBinaryObject po = prj.get(1);

See `keepBinary()` method JavaDoc for more details.

### Method Summary

Methods
`Affinity<K>` `affinity()` Gets affinity service to provide information about data partitioning and distribution.
`<K1,V1> IgniteInternalCache<K1,V1>` `cache()` Gets base cache for this projection.
`void` `clear()` Clears cache on all nodes that store it's data.
`void` `clear(K key)` Clears key on all nodes that store it's data.
`void` `clearAll(Set<? extends K> keys)` Clears keys on all nodes that store it's data.
`IgniteInternalFuture<?>` `clearAllAsync(Set<? extends K> keys)`
`IgniteInternalFuture<?>` `clearAsync()`
`IgniteInternalFuture<?>` `clearAsync(K key)`
`void` `clearLocally(boolean srv, boolean near, boolean readers)` Clears all entries from this cache only if the entry is not currently locked or participating in a transaction.
`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.
`CacheMetrics` `clusterMetrics()` Gets whole cluster metrics (statistics) for this cache.
`CacheMetrics` `clusterMetrics(ClusterGroup grp)` Gets cluster group metrics (statistics) for this cache.
`CacheMetricsMXBean` `clusterMxBean()` Gets whole cluster metrics (statistics) for this cache.
`CacheConfiguration` `configuration()` Gets configuration bean for this cache.
`boolean` `containsKey(K key)`
`IgniteInternalFuture<Boolean>` `containsKeyAsync(K key)`
`boolean` `containsKeys(Collection<? extends K> keys)`
`IgniteInternalFuture<Boolean>` `containsKeysAsync(Collection<? extends K> keys)`
`GridCacheContext<K,V>` `context()`
`Set<javax.cache.Cache.Entry<K,V>>` `entrySet()` Gets set of all entries cached on this node.
`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.
`Set<javax.cache.Cache.Entry<K,V>>` `entrySetx(CacheEntryPredicate... filter)` Gets entry set containing internal entries.
`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.
`javax.cache.expiry.ExpiryPolicy` `expiry()`
`IgniteInternalCache<K,V>` `forSubjectId(UUID subjId)` Creates projection for specified subject ID.
`V` `get(K key)` Retrieves value mapped to the specified key from cache.
`Map<K,V>` `getAll(Collection<? extends K> keys)` Retrieves values mapped to the specified keys from cache.
`IgniteInternalFuture<Map<K,V>>` `getAllAsync(Collection<? extends K> keys)` Asynchronously retrieves values mapped to the specified keys from cache.
`Map<K,V>` `getAllOutTx(Set<? extends K> keys)` Gets values from cache.
`IgniteInternalFuture<Map<K,V>>` `getAllOutTxAsync(Set<? extends K> keys)` Gets values from cache.
`V` `getAndPut(K key, V val)` Stores given key-value pair in cache.
`IgniteInternalFuture<V>` `getAndPutAsync(K key, V val)` Asynchronously stores given key-value pair in cache.
`V` `getAndPutIfAbsent(K key, V val)` Stores given key-value pair in cache only if cache had no previous mapping for it.
`IgniteInternalFuture<V>` `getAndPutIfAbsentAsync(K key, V val)` Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.
`V` `getAndRemove(K key)` Removes given key mapping from cache.
`IgniteInternalFuture<V>` `getAndRemoveAsync(K key)` Asynchronously removes given key mapping from cache.
`V` `getAndReplace(K key, V val)` Stores given key-value pair in cache only if there is a previous mapping for it.
`IgniteInternalFuture<V>` `getAndReplaceAsync(K key, V val)` Asynchronously stores given key-value pair in cache only if there is a previous mapping for it.
`IgniteInternalFuture<V>` `getAsync(K key)` Asynchronously retrieves value mapped to the specified key from cache.
`Collection<CacheEntry<K,V>>` `getEntries(Collection<? extends K> keys)` Retrieves values mapped to the specified keys from cache.
`IgniteInternalFuture<Collection<CacheEntry<K,V>>>` `getEntriesAsync(Collection<? extends K> keys)` Asynchronously retrieves values mapped to the specified keys from cache.
`CacheEntry<K,V>` `getEntry(K key)` Retrieves value mapped to the specified key from cache.
`IgniteInternalFuture<CacheEntry<K,V>>` `getEntryAsync(K key)` Asynchronously retrieves value mapped to the specified key from cache.
`V` `getForcePrimary(K key)` Gets value from cache.
`IgniteInternalFuture<V>` `getForcePrimaryAsync(K key)` Asynchronously gets value from cache.
`V` `getTopologySafe(K key)` Gets value without waiting for toplogy changes.
`long` `igfsDataSpaceMax()` Get maximum space available for IGFS.
`long` `igfsDataSpaceUsed()` Get current amount of used IGFS space in bytes.
`<T> javax.cache.processor.EntryProcessorResult<T>` `invoke(AffinityTopologyVersion topVer, K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)`
`<T> javax.cache.processor.EntryProcessorResult<T>` `invoke(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)`
`<T> Map<K,javax.cache.processor.EntryProcessorResult<T>>` `invokeAll(Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,T>> map, Object... args)`
`<T> Map<K,javax.cache.processor.EntryProcessorResult<T>>` `invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)`
`<T> IgniteInternalFuture<Map<K,javax.cache.processor.EntryProcessorResult<T>>>` `invokeAllAsync(Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,T>> map, Object... args)`
`<T> IgniteInternalFuture<Map<K,javax.cache.processor.EntryProcessorResult<T>>>` `invokeAllAsync(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)`
`<T> IgniteInternalFuture<javax.cache.processor.EntryProcessorResult<T>>` `invokeAsync(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)`
`boolean` `isEmpty()` Returns `true` if this map contains no key-value mappings.
`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` `isLockedByThread(K key)` Checks if current thread owns a lock on this key.
`boolean` `isMongoDataCache()` Checks whether this cache is Mongo data cache.
`boolean` `isMongoMetaCache()` Checks whether this cache is Mongo meta cache.
`<K1,V1> IgniteInternalCache<K1,V1>` `keepBinary()` Creates projection that will operate with binary objects.
`Set<K>` `keySet()` Set of keys cached on this node.
`Set<K>` `keySetx()`
`Iterable<javax.cache.Cache.Entry<K,V>>` `localEntries(CachePeekMode[] peekModes)`
`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.
`CacheMetrics` `localMetrics()` Gets local metrics (statistics) for this cache.
`CacheMetricsMXBean` `localMxBean()` Gets local metrics (statistics) for this cache.
`V` `localPeek(K key, CachePeekMode[] peekModes, IgniteCacheExpiryPolicy plc)`
`int` `localSize(CachePeekMode[] peekModes)`
`long` `localSizeLong(CachePeekMode[] peekModes)`
`long` `localSizeLong(int partition, CachePeekMode[] peekModes)`
`boolean` `lock(K key, long timeout)` Synchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes.
`boolean` `lockAll(Collection<? extends K> keys, long timeout)` All or nothing synchronous lock for passed in keys.
`IgniteInternalFuture<Boolean>` `lockAllAsync(Collection<? extends K> keys, long timeout)` All or nothing synchronous lock for passed in keys.
`IgniteInternalFuture<Boolean>` `lockAsync(K key, long timeout)` Asynchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes.
`String` `name()` Gets name of this cache (`null` for default cache).
`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.
`long` `overflowSize()` Gets size (in bytes) of all entries swapped to disk.
`Set<K>` `primaryKeySet()` Set of keys for which this node is primary.
`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` `promoteAll(Collection<? extends K> keys)` This method unswaps cache entries by given keys, if any, from swap storage into memory.
`boolean` `put(K key, V val)` Stores given key-value pair in cache.
`void` `putAll(Map<? extends K,? extends V> m)` Stores given key-value pairs in cache.
`IgniteInternalFuture<?>` `putAllAsync(Map<? extends K,? extends V> m)` Asynchronously stores given key-value pairs in cache.
`void` `putAllConflict(Map<KeyCacheObject,GridCacheDrInfo> drMap)` Store DR data.
`IgniteInternalFuture<?>` `putAllConflictAsync(Map<KeyCacheObject,GridCacheDrInfo> drMap)` Store DR data asynchronously.
`IgniteInternalFuture<Boolean>` `putAsync(K key, V val)` Stores given key-value pair in cache.
`boolean` `putIfAbsent(K key, V val)` Stores given key-value pair in cache only if cache had no previous mapping for it.
`IgniteInternalFuture<Boolean>` `putIfAbsentAsync(K key, V val)` Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.
`IgniteInternalFuture<?>` `rebalance()` Forces this cache node to re-balance its partitions.
`boolean` `remove(K key)` Removes given key mapping from cache.
`boolean` `remove(K key, V val)` Removes given key mapping from cache if one exists and value is equal to the passed in value.
`void` `removeAll()` Removes mappings from cache.
`void` `removeAll(Collection<? extends K> keys)` Removes given key mappings from cache.
`IgniteInternalFuture<?>` `removeAllAsync()`
`IgniteInternalFuture<?>` `removeAllAsync(Collection<? extends K> keys)` Asynchronously removes given key mappings from cache for entries.
`void` `removeAllConflict(Map<KeyCacheObject,GridCacheVersion> drMap)` Removes DR data.
`IgniteInternalFuture<?>` `removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> drMap)` Removes DR data asynchronously.
`IgniteInternalFuture<Boolean>` `removeAsync(K key)` Asynchronously removes given key mapping from cache.
`IgniteInternalFuture<Boolean>` `removeAsync(K key, V val)` Asynchronously removes given key mapping from cache if one exists and value is equal to the passed in value.
`boolean` `replace(K key, V val)` Stores given key-value pair in cache only if only if there is a previous mapping for it.
`boolean` `replace(K key, V oldVal, V newVal)` Stores given key-value pair in cache only if only if the previous value is equal to the `'oldVal'` passed in.
`IgniteInternalFuture<Boolean>` `replaceAsync(K key, V val)` Asynchronously stores given key-value pair in cache only if only if there is a previous mapping for it.
`IgniteInternalFuture<Boolean>` `replaceAsync(K key, V oldVal, V newVal)` Asynchronously stores given key-value pair in cache only if only if the previous value is equal to the `'oldVal'` passed in.
`IgniteInternalCache<K,V>` `setSkipStore(boolean skipStore)`
`int` `size()` Gets the number of all entries cached on this node.
`int` `size(CachePeekMode[] peekModes)`
`IgniteInternalFuture<Integer>` `sizeAsync(CachePeekMode[] peekModes)`
`long` `sizeLong()` Gets the number of all entries cached on this node as a long value.
`long` `sizeLong(CachePeekMode[] peekModes)`
`long` `sizeLong(int partition, CachePeekMode[] peekModes)`
`IgniteInternalFuture<Long>` `sizeLongAsync(CachePeekMode[] peekModes)`
`IgniteInternalFuture<Long>` `sizeLongAsync(int partition, CachePeekMode[] peekModes)`
`boolean` `skipStore()`
`long` `swapKeys()` Gets number of swap entries (keys).
`long` `swapSize()` Gets size in bytes for swap space.
`V` `tryGetAndPut(K key, V val)` Tries to get and put value in cache.
`Transaction` `tx()` Gets transaction started by this thread or `null` if this thread does not have a transaction.
`Transaction` `txStart(TransactionConcurrency concurrency, TransactionIsolation isolation)` Starts new transaction with the specified concurrency and isolation.
`Transaction` `txStart(TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, int txSize)` Starts transaction with specified isolation, concurrency, timeout, invalidation flag, and number of participating entries.
`IgniteInternalTx` `txStartEx(TransactionConcurrency concurrency, TransactionIsolation isolation)`
`void` `unlock(K key)` Unlocks given key only if current thread owns the lock.
`void` `unlockAll(Collection<? extends K> keys)` Unlocks given keys only if current thread owns the locks.
`Iterable<V>` `values()` Collection of values cached on this node.
`IgniteInternalCache<K,V>` `withExpiryPolicy(javax.cache.expiry.ExpiryPolicy plc)`
`IgniteInternalCache<K,V>` `withNoRetries()`

### Methods inherited from interface java.lang.Iterable

`iterator`

### Method Detail

#### name

    String name()

Gets name of this cache (`null` for default cache).

Returns:
  Cache name.

#### cache

    <K1,V1> IgniteInternalCache<K1,V1> cache()

Gets base cache for this projection.

Type Parameters:
  `K1` - Cache key type.
  `V1` - Cache value type.
Returns:
  Base cache for this projection.

#### skipStore

    boolean skipStore()

Returns:
  Skip store.

#### setSkipStore

    IgniteInternalCache<K,V> setSkipStore(boolean skipStore)

Parameters:
  `skipStore` - Skip store flag.
Returns:
  New internal cache instance based on this one, but with skip store flag enabled.

#### keepBinary

    <K1,V1> IgniteInternalCache<K1,V1> keepBinary()

Creates projection that will operate with binary objects.

Projection returned by this method will force cache not to deserialize binary objects, so keys and values will be returned from cache API methods without changes. Therefore, signature of the projection can contain only following types:

- `org.gridgain.grid.binary.BinaryObject` for binary classes
- All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)
- Arrays of primitives (byte[], int[], ...)
- `String` and array of `String`s
- `UUID` and array of `UUID`s
- `Date` and array of `Date`s
- `Timestamp` and array of `Timestamp`s
- Enums and array of enums
- Maps, collections and array of objects (but objects inside them will still be converted if they are binary)

For example, if you use `Integer` as a key and `Value` class as a value (which will be stored in binary format), you should acquire following projection to avoid deserialization:

     IgniteInternalCache<Integer, GridBinaryObject> prj = cache.keepBinary();

     // Value is not deserialized and returned in binary format.
     GridBinaryObject po = prj.get(1);

Note that this method makes sense only if cache is working in binary mode (`org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled()` returns `true`. If not, this method is no-op and will return current projection.

Returns:
  New internal cache instance for binary objects.

#### isEmpty

    boolean isEmpty()

Returns `true` if this map contains no key-value mappings.

Returns:
  `true` if this map contains no key-value mappings.

#### containsKey

    boolean containsKey(K key)

Parameters:
  `key` - Key.
Returns:
  `True` if cache contains mapping for a given key.

#### containsKeyAsync

    IgniteInternalFuture<Boolean> containsKeyAsync(K key)

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

#### containsKeys

    boolean containsKeys(Collection<? extends K> keys)

Parameters:
  `keys` - Keys,
Returns:
  `True` if cache contains all keys.

#### containsKeysAsync

    IgniteInternalFuture<Boolean> containsKeysAsync(Collection<? extends K> keys)

Parameters:
  `keys` - Keys to check.
Returns:
  Future.

#### localPeek

    @Nullable
    V localPeek(K key,
                       CachePeekMode[] peekModes,
                       @Nullable
                       IgniteCacheExpiryPolicy plc)
                throws IgniteCheckedException

Parameters:
  `key` - Key.
  `peekModes` - Peek modes.
  `plc` - Expiry policy if TTL should be updated.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### localEntries

    Iterable<javax.cache.Cache.Entry<K,V>> localEntries(CachePeekMode[] peekModes)
                                                        throws IgniteCheckedException

Parameters:
  `peekModes` - Peek modes.
Returns:
  Entries iterable.
Throws:
  `IgniteCheckedException` - If failed.

#### get

    @Nullable
    V get(K key)
          throws IgniteCheckedException

Retrieves value mapped to the specified key from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. The return value of `null` means entry did not pass the provided filter or cache has no mapping for the key.

If the value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disable, and if read-through is allowed, value will be loaded from `CacheStore` persistent storage via `CacheStore#load(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to retrieve the value for.
Returns:
  Value for the given key.
Throws:
  `IgniteCheckedException` - If get operation failed.
  `NullPointerException` - if the key is `null`.

#### getEntry

    @Nullable
    CacheEntry<K,V> getEntry(K key)
                             throws IgniteCheckedException

Retrieves value mapped to the specified key from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. The return value of `null` means entry did not pass the provided filter or cache has no mapping for the key.

If the value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disable, and if read-through is allowed, value will be loaded from `CacheStore` persistent storage via `CacheStore#load(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to retrieve the value for.
Returns:
  Value for the given key.
Throws:
  `IgniteCheckedException` - If get operation failed.
  `NullPointerException` - if the key is `null`.

#### getAsync

    IgniteInternalFuture<V> getAsync(K key)

Asynchronously retrieves value mapped to the specified key from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. The return value of `null` means entry did not pass the provided filter or cache has no mapping for the key.

If the value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disabled, and if read-through is allowed, value will be loaded from `CacheStore` persistent storage via `CacheStore#load(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key for the value to get.
Returns:
  Future for the get operation.
Throws:
  `NullPointerException` - if the key is `null`.

#### getEntryAsync

    IgniteInternalFuture<CacheEntry<K,V>> getEntryAsync(K key)

Asynchronously retrieves value mapped to the specified key from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. The return value of `null` means entry did not pass the provided filter or cache has no mapping for the key.

If the value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disabled, and if read-through is allowed, value will be loaded from `CacheStore` persistent storage via `CacheStore#load(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key for the value to get.
Returns:
  Future for the get operation.
Throws:
  `NullPointerException` - if the key is `null`.

#### getAll

    Map<K,V> getAll(@Nullable
                  Collection<? extends K> keys)
                    throws IgniteCheckedException

Retrieves values mapped to the specified keys from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. If requested key-value pair is not present in the returned map, then it means that its entry did not pass the provided filter or cache has no mapping for the key.

If some value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disabled, and if read-through is allowed, value will be loaded from `CacheStore` persistent storage via `CacheStore#loadAll(Transaction, Collection, org.apache.ignite.lang.IgniteBiInClosure)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `keys` - Keys to get.
Returns:
  Map of key-value pairs.
Throws:
  `IgniteCheckedException` - If get operation failed.

#### getEntries

    Collection<CacheEntry<K,V>> getEntries(@Nullable
                                         Collection<? extends K> keys)
                                           throws IgniteCheckedException

Retrieves values mapped to the specified keys from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. If requested key-value pair is not present in the returned map, then it means that its entry did not pass the provided filter or cache has no mapping for the key.

If some value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disabled, and if read-through is allowed, value will be loaded from `CacheStore` persistent storage via `CacheStore#loadAll(Transaction, Collection, org.apache.ignite.lang.IgniteBiInClosure)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `keys` - Keys to get.
Returns:
  Map of key-value pairs.
Throws:
  `IgniteCheckedException` - If get operation failed.

#### getAllAsync

    IgniteInternalFuture<Map<K,V>> getAllAsync(@Nullable
                                             Collection<? extends K> keys)

Asynchronously retrieves values mapped to the specified keys from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. If requested key-value pair is not present in the returned map, then it means that its entry did not pass the provided filter or cache has no mapping for the key.

If some value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disabled, and if read-through is allowed, value will be loaded from `CacheStore` persistent storage via `CacheStore#loadAll(Transaction, Collection, org.apache.ignite.lang.IgniteBiInClosure)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `keys` - Key for the value to get.
Returns:
  Future for the get operation.

#### getEntriesAsync

    IgniteInternalFuture<Collection<CacheEntry<K,V>>> getEntriesAsync(@Nullable
                                                                    Collection<? extends K> keys)

Asynchronously retrieves values mapped to the specified keys from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. If requested key-value pair is not present in the returned map, then it means that its entry did not pass the provided filter or cache has no mapping for the key.

If some value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disabled, and if read-through is allowed, value will be loaded from `CacheStore` persistent storage via `CacheStore#loadAll(Transaction, Collection, org.apache.ignite.lang.IgniteBiInClosure)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `keys` - Key for the value to get.
Returns:
  Future for the get operation.

#### getAndPut

    @Nullable
    V getAndPut(K key,
                       V val)
                throws IgniteCheckedException

Stores given key-value pair in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters. If cache previously contained value for the given key, then this value is returned. In case of `CacheMode.PARTITIONED` or `CacheMode.REPLICATED` caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage, `CacheStore#load(Transaction, Object)` method will be used.

If the returned value is not needed, method `#putx(Object, Object, org.apache.ignite.lang.IgnitePredicate[])` should always be used instead of this one to avoid the overhead associated with returning of the previous value.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Previous value associated with specified key, or `null` if entry did not pass the filter, or if there was no mapping for the key in swap or in persistent storage.
Throws:
  `NullPointerException` - If either key or value are `null`.
  `IgniteCheckedException` - If put operation failed.

#### getAndPutAsync

    IgniteInternalFuture<V> getAndPutAsync(K key,
                                         V val)

Asynchronously stores given key-value pair in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters. If cache previously contained value for the given key, then this value is returned. Otherwise, in case of `CacheMode.REPLICATED` caches, the value will be loaded from swap and, if it's not there, and read-through is allowed, from the underlying `CacheStore` storage. In case of `CacheMode.PARTITIONED` caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap and read-through is allowed, from the underlying persistent storage. If value has to be loaded from persistent storage, `CacheStore#load(Transaction, Object)` method will be used.

If the returned value is not needed, method `#putx(Object, Object, org.apache.ignite.lang.IgnitePredicate[])` should always be used instead of this one to avoid the overhead associated with returning of the previous value.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Future for the put operation.
Throws:
  `NullPointerException` - If either key or value are `null`.

#### put

    boolean put(K key,
              V val)
                throws IgniteCheckedException

Stores given key-value pair in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters.

This method will return `true` if value is stored in cache and `false` otherwise. Unlike `#put(Object, Object, org.apache.ignite.lang.IgnitePredicate[])` method, it does not return previous value and, therefore, does not have any overhead associated with returning a value. It should be used whenever return value is not required.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  `True` if optional filter passed and value was stored in cache, `false` otherwise. Note that this method will return `true` if filter is not specified.
Throws:
  `NullPointerException` - If either key or value are `null`.
  `IgniteCheckedException` - If put operation failed.

#### putAsync

    IgniteInternalFuture<Boolean> putAsync(K key,
                                         V val)

Stores given key-value pair in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters.

This method will return `true` if value is stored in cache and `false` otherwise. Unlike `#put(Object, Object, org.apache.ignite.lang.IgnitePredicate[])` method, it does not return previous value and, therefore, does not have any overhead associated with returning of a value. It should always be used whenever return value is not required.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Future for the put operation. Future will return `true` if optional filter passed and value was stored in cache, `false` otherwise. Note that future will return `true` if filter is not specified.
Throws:
  `NullPointerException` - If either key or value are `null`.

#### getAndPutIfAbsent

    @Nullable
    V getAndPutIfAbsent(K key,
                               V val)
                        throws IgniteCheckedException

Stores given key-value pair in cache only if cache had no previous mapping for it. If cache previously contained value for the given key, then this value is returned. In case of `CacheMode.PARTITIONED` or `CacheMode.REPLICATED` caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage, `CacheStore#load(Transaction, Object)` method will be used.

If the returned value is not needed, method `putIfAbsent(Object, Object)` should always be used instead of this one to avoid the overhead associated with returning of the previous value.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Previously contained value regardless of whether put happened or not.
Throws:
  `NullPointerException` - If either key or value are `null`.
  `IgniteCheckedException` - If put operation failed.

#### getAndPutIfAbsentAsync

    IgniteInternalFuture<V> getAndPutIfAbsentAsync(K key,
                                                 V val)

Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it. If cache previously contained value for the given key, then this value is returned. In case of `CacheMode.PARTITIONED` or `CacheMode.REPLICATED` caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage, `CacheStore#load(Transaction, Object)` method will be used.

If the returned value is not needed, method `putIfAbsentAsync(Object, Object)` should always be used instead of this one to avoid the overhead associated with returning of the previous value.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Future of put operation which will provide previously contained value regardless of whether put happened or not.
Throws:
  `NullPointerException` - If either key or value are `null`.

#### putIfAbsent

    boolean putIfAbsent(K key,
                      V val)
                        throws IgniteCheckedException

Stores given key-value pair in cache only if cache had no previous mapping for it.

This method will return `true` if value is stored in cache and `false` otherwise. Unlike `getAndPutIfAbsent(Object, Object)` method, it does not return previous value and, therefore, does not have any overhead associated with returning of a value. It should always be used whenever return value is not required.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  `true` if value is stored in cache and `false` otherwise.
Throws:
  `NullPointerException` - If either key or value are `null`.
  `IgniteCheckedException` - If put operation failed.

#### putIfAbsentAsync

    IgniteInternalFuture<Boolean> putIfAbsentAsync(K key,
                                                 V val)

Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.

This method will return `true` if value is stored in cache and `false` otherwise. Unlike `getAndPutIfAbsent(Object, Object)` method, it does not return previous value and, therefore, does not have any overhead associated with returning of a value. It should always be used whenever return value is not required.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Future for this put operation.
Throws:
  `NullPointerException` - If either key or value are `null`.

#### getAndReplace

    @Nullable
    V getAndReplace(K key,
                           V val)
                    throws IgniteCheckedException

Stores given key-value pair in cache only if there is a previous mapping for it. In case of `CacheMode.PARTITIONED` or `CacheMode.REPLICATED` caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage, `CacheStore#load(Transaction, Object)` method will be used.

If the returned value is not needed, method `replace(Object, Object)` should always be used instead of this one to avoid the overhead associated with returning of the previous value.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Previously contained value regardless of whether replace happened or not.
Throws:
  `NullPointerException` - If either key or value are `null`.
  `IgniteCheckedException` - If replace operation failed.

#### getAndReplaceAsync

    IgniteInternalFuture<V> getAndReplaceAsync(K key,
                                             V val)

Asynchronously stores given key-value pair in cache only if there is a previous mapping for it. If cache previously contained value for the given key, then this value is returned.In case of `CacheMode.PARTITIONED` caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage, `CacheStore#load(Transaction, Object)` method will be used.

If the returned value is not needed, method `replace(Object, Object)` should always be used instead of this one to avoid the overhead associated with returning of the previous value.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Future for replace operation.
Throws:
  `NullPointerException` - If either key or value are `null`.

#### replace

    boolean replace(K key,
                  V val)
                    throws IgniteCheckedException

Stores given key-value pair in cache only if only if there is a previous mapping for it.

This method will return `true` if value is stored in cache and `false` otherwise. Unlike `getAndReplace(Object, Object)` method, it does not return previous value and, therefore, does not have any overhead associated with returning of a value. It should always be used whenever return value is not required.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  `True` if replace happened, `false` otherwise.
Throws:
  `NullPointerException` - If either key or value are `null`.
  `IgniteCheckedException` - If replace operation failed.

#### replaceAsync

    IgniteInternalFuture<Boolean> replaceAsync(K key,
                                             V val)

Asynchronously stores given key-value pair in cache only if only if there is a previous mapping for it.

This method will return `true` if value is stored in cache and `false` otherwise. Unlike `getAndReplaceAsync(Object, Object)` method, it does not return previous value and, therefore, does not have any overhead associated with returning of a value. It should always be used whenever return value is not required.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Future for the replace operation.
Throws:
  `NullPointerException` - If either key or value are `null`.

#### replace

    boolean replace(K key,
                  V oldVal,
                  V newVal)
                    throws IgniteCheckedException

Stores given key-value pair in cache only if only if the previous value is equal to the `'oldVal'` passed in.

This method will return `true` if value is stored in cache and `false` otherwise.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `oldVal` - Old value to match.
  `newVal` - Value to be associated with the given key.
Returns:
  `True` if replace happened, `false` otherwise.
Throws:
  `NullPointerException` - If either key or value are `null`.
  `IgniteCheckedException` - If replace operation failed.

#### replaceAsync

    IgniteInternalFuture<Boolean> replaceAsync(K key,
                                             V oldVal,
                                             V newVal)

Asynchronously stores given key-value pair in cache only if only if the previous value is equal to the `'oldVal'` passed in.

This method will return `true` if value is stored in cache and `false` otherwise.

If write-through is enabled, the stored value will be persisted to `CacheStore` via `CacheStore#put(Transaction, Object, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key to store in cache.
  `oldVal` - Old value to match.
  `newVal` - Value to be associated with the given key.
Returns:
  Future for the replace operation.
Throws:
  `NullPointerException` - If either key or value are `null`.

#### putAll

    void putAll(@Nullable
              Map<? extends K,? extends V> m)
                throws IgniteCheckedException

Stores given key-value pairs in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters.

If write-through is enabled, the stored values will be persisted to `CacheStore` via `CacheStore#putAll(Transaction, Map)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `m` - Key-value pairs to store in cache.
Throws:
  `IgniteCheckedException` - If put operation failed.

#### putAllAsync

    IgniteInternalFuture<?> putAllAsync(@Nullable
                                      Map<? extends K,? extends V> m)

Asynchronously stores given key-value pairs in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters.

If write-through is enabled, the stored values will be persisted to `CacheStore` via `CacheStore#putAll(Transaction, Map)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `m` - Key-value pairs to store in cache.
Returns:
  Future for putAll operation.

#### keySet

    Set<K> keySet()

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

Iterator over this set will not fail if set was concurrently updated by another thread. This means that iterator may or may not return latest keys depending on whether they were added before or after current iterator position.

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

Returns:
  Key set for this cache projection.

#### keySetx

    Set<K> keySetx()

Returns:
  Set of keys including internal keys.

#### primaryKeySet

    Set<K> primaryKeySet()

Set of keys for which this node is primary. This set is dynamic and may change with grid topology changes. Note that this set will contain mappings for all keys, even if their values are `null` because they were invalidated. You can remove elements from this set, but you cannot add elements to this set. All removal operation will be reflected on the cache itself.

Iterator over this set will not fail if set was concurrently updated by another thread. This means that iterator may or may not return latest keys depending on whether they were added before or after current iterator position.

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

Returns:
  Primary key set for the current node.

#### values

    Iterable<V> values()

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.

Returns:
  Collection of cached values.

#### entrySet

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

Gets set of all entries cached on this node. You can remove elements from this set, but you cannot add elements to this set. All removal operation will be reflected on the cache itself.

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

Returns:
  Entries that pass through key filter.

#### entrySet

    @Nullable
    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.

Parameters:
  `part` - Partition.
Returns:
  Set containing partition's entries or `null` if partition is not found locally.

#### txStart

    Transaction txStart(TransactionConcurrency concurrency,
                      TransactionIsolation isolation)

Starts new transaction with the specified concurrency and isolation.

Parameters:
  `concurrency` - Concurrency.
  `isolation` - Isolation.
Returns:
  New transaction.
Throws:
  `IllegalStateException` - If transaction is already started by this thread.
  `UnsupportedOperationException` - If cache is `CacheAtomicityMode.ATOMIC`.

#### txStartEx

    IgniteInternalTx txStartEx(TransactionConcurrency concurrency,
                             TransactionIsolation isolation)

Parameters:
  `concurrency` - Concurrency.
  `isolation` - Isolation.
Returns:
  New transaction.

#### txStart

    Transaction txStart(TransactionConcurrency concurrency,
                      TransactionIsolation isolation,
                      long timeout,
                      int txSize)

Starts transaction with specified isolation, concurrency, timeout, invalidation flag, and number of participating entries.

Parameters:
  `concurrency` - Concurrency.
  `isolation` - Isolation.
  `timeout` - Timeout.
  `txSize` - Number of entries participating in transaction (may be approximate).
Returns:
  New transaction.
Throws:
  `IllegalStateException` - If transaction is already started by this thread.
  `UnsupportedOperationException` - If cache is `CacheAtomicityMode.ATOMIC`.

#### tx

    @Nullable
    Transaction tx()

Gets transaction started by this thread or `null` if this thread does not have a transaction.

Returns:
  Transaction started by this thread or `null` if this thread does not have a transaction.

#### evict

    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.

Parameters:
  `key` - Key to evict from cache.
Returns:
  `True` if entry could be evicted, `false` otherwise.

#### evictAll

    void evictAll(@Nullable
                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.

Parameters:
  `keys` - Keys to evict.

#### clearLocally

    void clearLocally(boolean srv,
                    boolean near,
                    boolean readers)

Clears all entries from this cache only if the entry is not currently locked or 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 entries from local cache. It does not remove entries from remote caches or from underlying persistent storage.

Parameters:
  `srv` - Whether to clear server cache.
  `near` - Whether to clear near cache.
  `readers` - Whether to clear readers.

#### clearLocally

    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.

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

    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.

Parameters:
  `keys` - Keys to clearLocally.
  `srv` - Whether to clear server cache.
  `near` - Whether to clear near cache.
  `readers` - Whether to clear readers.

#### clear

    void clear(K key)
               throws IgniteCheckedException

Clears key on all nodes that store it's data. That is, caches are cleared on remote nodes and local node, as opposed to `clearLocally(Object)` method which only clears local node's cache.

Ignite will make the best attempt to clear caches on all nodes. If some caches could not be cleared, then exception will be thrown.

Parameters:
  `key` - Key to clear.
Throws:
  `IgniteCheckedException` - In case of cache could not be cleared on any of the nodes.

#### clearAll

    void clearAll(Set<? extends K> keys)
                  throws IgniteCheckedException

Clears keys on all nodes that store it's data. That is, caches are cleared on remote nodes and local node, as opposed to `clearLocallyAll(Set, boolean, boolean, boolean)` method which only clears local node's cache.

Ignite will make the best attempt to clear caches on all nodes. If some caches could not be cleared, then exception will be thrown.

Parameters:
  `keys` - Keys to clear.
Throws:
  `IgniteCheckedException` - In case of cache could not be cleared on any of the nodes.

#### clear

    void clear()
               throws IgniteCheckedException

Clears cache on all nodes that store it's data. That is, caches are cleared on remote nodes and local node, as opposed to `clearLocally(boolean, boolean, boolean)` method which only clears local node's cache.

Ignite will make the best attempt to clear caches on all nodes. If some caches could not be cleared, then exception will be thrown.

Throws:
  `IgniteCheckedException` - In case of cache could not be cleared on any of the nodes.

#### clearAsync

    IgniteInternalFuture<?> clearAsync()

Returns:
  Clear future.

#### clearAsync

    IgniteInternalFuture<?> clearAsync(K key)

Parameters:
  `key` - Key to clear.
Returns:
  Clear future.

#### clearAllAsync

    IgniteInternalFuture<?> clearAllAsync(Set<? extends K> keys)

Parameters:
  `keys` - Keys to clear.
Returns:
  Clear future.

#### getAndRemove

    @Nullable
    V getAndRemove(K key)
                   throws IgniteCheckedException

Removes given key mapping from cache. If cache previously contained value for the given key, then this value is returned. In case of `CacheMode.PARTITIONED` or `CacheMode.REPLICATED` caches, the value will be loaded from the primary node, which in its turn may load the value from the disk-based swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage, `CacheStore#load(Transaction, Object)` method will be used.

If the returned value is not needed, method `#removex(Object, org.apache.ignite.lang.IgnitePredicate[])` should always be used instead of this one to avoid the overhead associated with returning of the previous value.

If write-through is enabled, the value will be removed from `CacheStore` via `CacheStore#remove(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key whose mapping is to be removed from cache.
Returns:
  Previous value associated with specified key, or `null` if there was no value for this key.
Throws:
  `NullPointerException` - If key is `null`.
  `IgniteCheckedException` - If remove operation failed.

#### getAndRemoveAsync

    IgniteInternalFuture<V> getAndRemoveAsync(K key)

Asynchronously removes given key mapping from cache. If cache previously contained value for the given key, then this value is returned. In case of `CacheMode.PARTITIONED` or `CacheMode.REPLICATED` caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage, `CacheStore#load(Transaction, Object)` method will be used.

If the returned value is not needed, method `#removex(Object, org.apache.ignite.lang.IgnitePredicate[])` should always be used instead of this one to avoid the overhead associated with returning of the previous value.

If write-through is enabled, the value will be removed from `CacheStore` via `CacheStore#remove(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key whose mapping is to be removed from cache.
Returns:
  Future for the remove operation.
Throws:
  `NullPointerException` - if the key is `null`.

#### remove

    boolean remove(K key)
                   throws IgniteCheckedException

Removes given key mapping from cache.

This method will return `true` if remove did occur, which means that all optionally provided filters have passed and there was something to remove, `false` otherwise.

If write-through is enabled, the value will be removed from `CacheStore` via `CacheStore#remove(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key whose mapping is to be removed from cache.
Returns:
  `True` if filter passed validation and entry was removed, `false` otherwise. Note that if filter is not specified, this method will return `true`.
Throws:
  `NullPointerException` - if the key is `null`.
  `IgniteCheckedException` - If remove failed.

#### removeAsync

    IgniteInternalFuture<Boolean> removeAsync(K key)

Asynchronously removes given key mapping from cache.

This method will return `true` if remove did occur, which means that all optionally provided filters have passed and there was something to remove, `false` otherwise.

If write-through is enabled, the value will be removed from `CacheStore` via `CacheStore#remove(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key whose mapping is to be removed from cache.
Returns:
  Future for the remove operation. The future will return `true` if optional filters passed validation and remove did occur, `false` otherwise. Note that if filter is not specified, this method will return `true`.
Throws:
  `NullPointerException` - if the key is `null`.

#### remove

    boolean remove(K key,
                 V val)
                   throws IgniteCheckedException

Removes given key mapping from cache if one exists and value is equal to the passed in value.

If write-through is enabled, the value will be removed from `CacheStore` via `CacheStore#remove(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key whose mapping is to be removed from cache.
  `val` - Value to match against currently cached value.
Returns:
  `True` if entry was removed and passed in value matched the cached one, `false` otherwise.
Throws:
  `NullPointerException` - if the key or value is `null`.
  `IgniteCheckedException` - If remove failed.

#### removeAsync

    IgniteInternalFuture<Boolean> removeAsync(K key,
                                            V val)

Asynchronously removes given key mapping from cache if one exists and value is equal to the passed in value.

This method will return `true` if remove did occur, which means that all optionally provided filters have passed and there was something to remove, `false` otherwise.

If write-through is enabled, the value will be removed from `CacheStore` via `CacheStore#remove(Transaction, Object)` method.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `key` - Key whose mapping is to be removed from cache.
  `val` - Value to match against currently cached value.
Returns:
  Future for the remove operation. The future will return `true` if currently cached value will match the passed in one.
Throws:
  `NullPointerException` - if the key or value is `null`.

#### removeAll

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

Removes given key mappings from cache.

If write-through is enabled, the values will be removed from `CacheStore` via `IgniteDataStreamer`.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `keys` - Keys whose mappings are to be removed from cache.
Throws:
  `IgniteCheckedException` - If remove failed.

#### removeAllAsync

    IgniteInternalFuture<?> removeAllAsync(@Nullable
                                         Collection<? extends K> keys)

Asynchronously removes given key mappings from cache for entries.

If write-through is enabled, the values will be removed from `CacheStore` via `IgniteDataStreamer`.

## Transactions

This method is transactional and will enlist the entry into ongoing transaction if there is one.

Parameters:
  `keys` - Keys whose mappings are to be removed from cache.
Returns:
  Future for the remove operation. The future will complete whenever remove operation completes.

#### removeAll

    void removeAll()
                   throws IgniteCheckedException

Removes mappings from cache.

USE WITH CARE - if your cache has many entries then transaction will quickly become very heavy and slow.

If write-through is enabled, the values will be removed from `CacheStore` via `IgniteDataStreamer`.

## Transactions

This method is not transactional.

Throws:
  `IgniteCheckedException` - If remove failed.

#### removeAllAsync

    IgniteInternalFuture<?> removeAllAsync()

Returns:
  Remove future.

#### lock

    boolean lock(K key,
               long timeout)
                 throws IgniteCheckedException

Synchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes. This method together with filter check will be executed as one atomic operation.

## Transactions

Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should use `TransactionConcurrency.PESSIMISTIC` concurrency control for transaction which will acquire explicit locks for relevant cache operations.

Parameters:
  `key` - Key to lock.
  `timeout` - Timeout in milliseconds to wait for lock to be acquired (`'0'` for no expiration), `-1` for immediate failure if lock cannot be acquired immediately).
Returns:
  `True` if all filters passed and lock was acquired, `false` otherwise.
Throws:
  `IgniteCheckedException` - If lock acquisition resulted in error.

#### lockAsync

    IgniteInternalFuture<Boolean> lockAsync(K key,
                                          long timeout)

Asynchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes. This method together with filter check will be executed as one atomic operation.

## Transactions

Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should use `TransactionConcurrency.PESSIMISTIC` concurrency control for transaction which will acquire explicit locks for relevant cache operations.

Parameters:
  `key` - Key to lock.
  `timeout` - Timeout in milliseconds to wait for lock to be acquired (`'0'` for no expiration, `-1` for immediate failure if lock cannot be acquired immediately).
Returns:
  Future for the lock operation. The future will return `true` whenever all filters pass and locks are acquired before timeout is expired, `false` otherwise.

#### lockAll

    boolean lockAll(@Nullable
                  Collection<? extends K> keys,
                  long timeout)
                    throws IgniteCheckedException

All or nothing synchronous lock for passed in keys. This method together with filter check will be executed as one atomic operation. If at least one filter validation failed, no locks will be acquired.

## Transactions

Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should use `TransactionConcurrency.PESSIMISTIC` concurrency control for transaction which will acquire explicit locks for relevant cache operations.

Parameters:
  `keys` - Keys to lock.
  `timeout` - Timeout in milliseconds to wait for lock to be acquired (`'0'` for no expiration).
Returns:
  `True` if all filters passed and locks were acquired before timeout has expired, `false` otherwise.
Throws:
  `IgniteCheckedException` - If lock acquisition resulted in error.

#### lockAllAsync

    IgniteInternalFuture<Boolean> lockAllAsync(@Nullable
                                             Collection<? extends K> keys,
                                             long timeout)

All or nothing synchronous lock for passed in keys. This method together with filter check will be executed as one atomic operation. If at least one filter validation failed, no locks will be acquired.

## Transactions

Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should use `TransactionConcurrency.PESSIMISTIC` concurrency control for transaction which will acquire explicit locks for relevant cache operations.

Parameters:
  `keys` - Keys to lock.
  `timeout` - Timeout in milliseconds to wait for lock to be acquired (`'0'` for no expiration).
Returns:
  Future for the collection of locks. The future will return `true` if all filters passed and locks were acquired before timeout has expired, `false` otherwise.

#### unlock

    void unlock(K key)
                throws IgniteCheckedException

Unlocks given key only if current thread owns the lock. If optional filter will not pass, then unlock will not happen. If the key being unlocked was never locked by current thread, then this method will do nothing.

## Transactions

Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should use `TransactionConcurrency.PESSIMISTIC` concurrency control for transaction which will acquire explicit locks for relevant cache operations.

Parameters:
  `key` - Key to unlock.
Throws:
  `IgniteCheckedException` - If unlock execution resulted in error.

#### unlockAll

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

Unlocks given keys only if current thread owns the locks. Only the keys that have been locked by calling thread and pass through the filter (if any) will be unlocked. If none of the key locks is owned by current thread, then this method will do nothing.

## Transactions

Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should use `TransactionConcurrency.PESSIMISTIC` concurrency control for transaction which will acquire explicit locks for relevant cache operations.

Parameters:
  `keys` - Keys to unlock.
Throws:
  `IgniteCheckedException` - If unlock execution resulted in error.

#### isLocked

    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.

Parameters:
  `key` - Key to check.
Returns:
  `True` if lock is owned by some node.

#### isLockedByThread

    boolean isLockedByThread(K key)

Checks if current thread owns a lock on this key.

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

Parameters:
  `key` - Key to check.
Returns:
  `True` if key is locked by current thread.

#### size

    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.

Returns:
  Size of cache on this node.

#### sizeLong

    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.

Returns:
  Size of cache on this node.

#### localSize

    int localSize(CachePeekMode[] peekModes)
                  throws IgniteCheckedException

Parameters:
  `peekModes` - Peek modes.
Returns:
  Local cache size.
Throws:
  `IgniteCheckedException` - If failed.

#### localSizeLong

    long localSizeLong(CachePeekMode[] peekModes)
                       throws IgniteCheckedException

Parameters:
  `peekModes` - Peek modes.
Returns:
  Local cache size as a long value.
Throws:
  `IgniteCheckedException` - If failed.

#### localSizeLong

    long localSizeLong(int partition,
                     CachePeekMode[] peekModes)
                       throws IgniteCheckedException

Parameters:
  `partition` - partition.
  `peekModes` - Peek modes.
Returns:
  Local cache size as a long value.
Throws:
  `IgniteCheckedException` - If failed.

#### size

    int size(CachePeekMode[] peekModes)
             throws IgniteCheckedException

Parameters:
  `peekModes` - Peek modes.
Returns:
  Global cache size.
Throws:
  `IgniteCheckedException` - If failed.

#### sizeLong

    long sizeLong(CachePeekMode[] peekModes)
                  throws IgniteCheckedException

Parameters:
  `peekModes` - Peek modes.
Returns:
  Global cache size as a long value.
Throws:
  `IgniteCheckedException` - If failed.

#### sizeLong

    long sizeLong(int partition,
                CachePeekMode[] peekModes)
                  throws IgniteCheckedException

Parameters:
  `partition` - partition
  `peekModes` - Peek modes.
Returns:
  Global cache size as a long value.
Throws:
  `IgniteCheckedException` - If failed.

#### sizeAsync

    IgniteInternalFuture<Integer> sizeAsync(CachePeekMode[] peekModes)

Parameters:
  `peekModes` - Peek modes.
Returns:
  Future.

#### sizeLongAsync

    IgniteInternalFuture<Long> sizeLongAsync(CachePeekMode[] peekModes)

Parameters:
  `peekModes` - Peek modes.
Returns:
  Future.

#### sizeLongAsync

    IgniteInternalFuture<Long> sizeLongAsync(int partition,
                                           CachePeekMode[] peekModes)

Parameters:
  `partition` - partiton
  `peekModes` - Peek modes.
Returns:
  Future.

#### nearSize

    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`

Returns:
  Size of near cache key set or `0` if cache is not `CacheMode.PARTITIONED`.

#### primarySize

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

Returns:
  Number of primary entries in cache.

#### primarySizeLong

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

Returns:
  Number of primary entries in cache.

#### promoteAll

    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.

Parameters:
  `keys` - Keys to promote entries for.
Throws:
  `IgniteCheckedException` - If promote failed.

#### configuration

    CacheConfiguration configuration()

Gets configuration bean for this cache.

Returns:
  Configuration bean for this cache.

#### affinity

    Affinity<K> affinity()

Gets affinity service to provide information about data partitioning and distribution.

Returns:
  Cache data affinity service.

#### clusterMetrics

    CacheMetrics clusterMetrics()

Gets whole cluster metrics (statistics) for this cache.

Returns:
  Cache metrics.

#### clusterMetrics

    CacheMetrics clusterMetrics(ClusterGroup grp)

Gets cluster group metrics (statistics) for this cache.

Parameters:
  `grp` - Cluster group.
Returns:
  Cache metrics.

#### localMetrics

    CacheMetrics localMetrics()

Gets local metrics (statistics) for this cache.

Returns:
  Cache metrics.

#### clusterMxBean

    CacheMetricsMXBean clusterMxBean()

Gets whole cluster metrics (statistics) for this cache.

Returns:
  Cache metrics.

#### localMxBean

    CacheMetricsMXBean localMxBean()

Gets local metrics (statistics) for this cache.

Returns:
  Cache metrics.

#### overflowSize

    long overflowSize()
                      throws IgniteCheckedException

Gets size (in bytes) of all entries swapped to disk.

Returns:
  Size (in bytes) of all entries swapped to disk.
Throws:
  `IgniteCheckedException` - In case of error.

#### offHeapEntriesCount

    long offHeapEntriesCount()

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

Returns:
  Number of cache entries stored in off-heap memory.

#### offHeapAllocatedSize

    long offHeapAllocatedSize()

Gets memory size allocated in off-heap.

Returns:
  Allocated memory size.

#### swapSize

    long swapSize()
                  throws IgniteCheckedException

Gets size in bytes for swap space.

Returns:
  Size in bytes.
Throws:
  `IgniteCheckedException` - If failed.

#### swapKeys

    long swapKeys()
                  throws IgniteCheckedException

Gets number of swap entries (keys).

Returns:
  Number of entries stored in swap.
Throws:
  `IgniteCheckedException` - If failed.

#### rebalance

    IgniteInternalFuture<?> rebalance()

Forces this cache node to re-balance its partitions. This method is usually used when `CacheConfiguration.getRebalanceDelay()` configuration parameter has non-zero value. When many nodes are started or stopped almost concurrently, it is more efficient to delay rebalancing until the node topology is stable to make sure that no redundant re-partitioning happens.

In case of`CacheMode.PARTITIONED` caches, for better efficiency user should usually make sure that new nodes get placed on the same place of consistent hash ring as the left nodes, and that nodes are restarted before `rebalanceDelay` expires. To place nodes on the same place in consistent hash ring, use `IgniteConfiguration.setConsistentId(Serializable)` to make sure that a node maps to the same hash ID if re-started.

See `CacheConfiguration.getRebalanceDelay()` for more information on how to configure rebalance re-partition delay.

Returns:
  Future that will be completed when rebalancing is finished.

#### forSubjectId

    IgniteInternalCache<K,V> forSubjectId(UUID subjId)

Creates projection for specified subject ID.

Parameters:
  `subjId` - Client ID.
Returns:
  Internal projection.

#### putAllConflict

    void putAllConflict(Map<KeyCacheObject,GridCacheDrInfo> drMap)
                        throws IgniteCheckedException

Store DR data.

Parameters:
  `drMap` - DR map.
Throws:
  `IgniteCheckedException` - If put operation failed.

#### putAllConflictAsync

    IgniteInternalFuture<?> putAllConflictAsync(Map<KeyCacheObject,GridCacheDrInfo> drMap)
                                                throws IgniteCheckedException

Store DR data asynchronously.

Parameters:
  `drMap` - DR map.
Returns:
  Future.
Throws:
  `IgniteCheckedException` - If put operation failed.

#### removeAllConflict

    void removeAllConflict(Map<KeyCacheObject,GridCacheVersion> drMap)
                           throws IgniteCheckedException

Removes DR data.

Parameters:
  `drMap` - DR map.
Throws:
  `IgniteCheckedException` - If remove failed.

#### removeAllConflictAsync

    IgniteInternalFuture<?> removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> drMap)
                                                   throws IgniteCheckedException

Removes DR data asynchronously.

Parameters:
  `drMap` - DR map.
Returns:
  Future.
Throws:
  `IgniteCheckedException` - If remove failed.

#### getForcePrimary

    @Nullable
    V getForcePrimary(K key)
                      throws IgniteCheckedException

Gets value from cache. Will go to primary node even if this is a backup.

Parameters:
  `key` - Key to get value for.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### getForcePrimaryAsync

    IgniteInternalFuture<V> getForcePrimaryAsync(K key)

Asynchronously gets value from cache. Will go to primary node even if this is a backup.

Parameters:
  `key` - Key to get value for.
Returns:
  Future with result.

#### getAllOutTx

    Map<K,V> getAllOutTx(Set<? extends K> keys)
                         throws IgniteCheckedException

Gets values from cache. Will bypass started transaction, if any, i.e. will not enlist entries and will not lock any keys if pessimistic transaction is started by thread.

Parameters:
  `keys` - Keys to get values for.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### getAllOutTxAsync

    IgniteInternalFuture<Map<K,V>> getAllOutTxAsync(Set<? extends K> keys)

Gets values from cache. Will bypass started transaction, if any, i.e. will not enlist entries and will not lock any keys if pessimistic transaction is started by thread.

Parameters:
  `keys` - Keys to get values for.
Returns:
  Future for getAllOutTx operation.

#### isIgfsDataCache

    boolean isIgfsDataCache()

Checks whether this cache is IGFS data cache.

Returns:
  `True` in case this cache is IGFS data cache.

#### igfsDataSpaceUsed

    long igfsDataSpaceUsed()

Get current amount of used IGFS space in bytes.

Returns:
  Amount of used IGFS space in bytes.

#### igfsDataSpaceMax

    long igfsDataSpaceMax()

Get maximum space available for IGFS.

Returns:
  Amount of space available for IGFS in bytes.

#### isMongoDataCache

    boolean isMongoDataCache()

Checks whether this cache is Mongo data cache.

Returns:
  `True` if this cache is mongo data cache.

#### isMongoMetaCache

    boolean isMongoMetaCache()

Checks whether this cache is Mongo meta cache.

Returns:
  `True` if this cache is mongo meta cache.

#### entrySetx

    Set<javax.cache.Cache.Entry<K,V>> entrySetx(CacheEntryPredicate... filter)

Gets entry set containing internal entries.

Parameters:
  `filter` - Filter.
Returns:
  Entry set.

#### expiry

    @Nullable
    javax.cache.expiry.ExpiryPolicy expiry()

Returns:
  `ExpiryPolicy` associated with this projection.

#### withExpiryPolicy

    IgniteInternalCache<K,V> withExpiryPolicy(javax.cache.expiry.ExpiryPolicy plc)

Parameters:
  `plc` - `ExpiryPolicy` to associate with this projection.
Returns:
  New projection based on this one, but with the specified expiry policy.

#### withNoRetries

    IgniteInternalCache<K,V> withNoRetries()

Returns:
  Cache with no-retries behavior enabled.

#### invoke

    @Nullable
    <T> javax.cache.processor.EntryProcessorResult<T> invoke(K key,
                                                                    javax.cache.processor.EntryProcessor<K,V,T> entryProcessor,
                                                                    Object... args)
                                                         throws IgniteCheckedException

Parameters:
  `key` - Key.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Invoke result.
Throws:
  `IgniteCheckedException` - If failed.

#### invokeAsync

    <T> IgniteInternalFuture<javax.cache.processor.EntryProcessorResult<T>> invokeAsync(K key,
                                                                                      javax.cache.processor.EntryProcessor<K,V,T> entryProcessor,
                                                                                      Object... args)

Parameters:
  `key` - Key.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Future.

#### invokeAll

    <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Set<? extends K> keys,
                                                                     javax.cache.processor.EntryProcessor<K,V,T> entryProcessor,
                                                                     Object... args)
                                                                   throws IgniteCheckedException

Parameters:
  `keys` - Keys.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Invoke results.
Throws:
  `IgniteCheckedException` - If failed.

#### invokeAllAsync

    <T> IgniteInternalFuture<Map<K,javax.cache.processor.EntryProcessorResult<T>>> invokeAllAsync(Set<? extends K> keys,
                                                                                                javax.cache.processor.EntryProcessor<K,V,T> entryProcessor,
                                                                                                Object... args)

Parameters:
  `keys` - Keys.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Future.

#### invokeAll

    <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,T>> map,
                                                                     Object... args)
                                                                   throws IgniteCheckedException

Parameters:
  `map` - Map containing keys and entry processors to be applied to values.
  `args` - Arguments.
Returns:
  Invoke results.
Throws:
  `IgniteCheckedException` - If failed.

#### invokeAllAsync

    <T> IgniteInternalFuture<Map<K,javax.cache.processor.EntryProcessorResult<T>>> invokeAllAsync(Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,T>> map,
                                                                                                Object... args)

Parameters:
  `map` - Map containing keys and entry processors to be applied to values.
  `args` - Arguments.
Returns:
  Future.

#### context

    GridCacheContext<K,V> context()

Returns:
  Context.

#### localLoadCache

    void localLoadCache(@Nullable
                      IgniteBiPredicate<K,V> p,
                      @Nullable
                      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.

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.

#### localLoadCacheAsync

    IgniteInternalFuture<?> localLoadCacheAsync(@Nullable
                                              IgniteBiPredicate<K,V> p,
                                              @Nullable
                                              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.

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.

#### getTopologySafe

    V getTopologySafe(K key)
                      throws IgniteCheckedException

Gets value without waiting for toplogy changes.

Parameters:
  `key` - Key.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### tryGetAndPut

    @Nullable
    V tryGetAndPut(K key,
                          V val)
                   throws IgniteCheckedException

Tries to get and put value in cache. Will fail with `GridCacheTryPutFailedException` if topology exchange is in progress.

Parameters:
  `key` - Key.
  `val` - value.
Returns:
  Old value.
Throws:
  `IgniteCheckedException` - In case of error.

#### invoke

    @Nullable
    <T> javax.cache.processor.EntryProcessorResult<T> invoke(@Nullable
                                                                    AffinityTopologyVersion topVer,
                                                                    K key,
                                                                    javax.cache.processor.EntryProcessor<K,V,T> entryProcessor,
                                                                    Object... args)
                                                         throws IgniteCheckedException

Parameters:
  `topVer` - Locked topology version.
  `key` - Key.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Invoke result.
Throws:
  `IgniteCheckedException` - If failed.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.7.0
Release Date | : August 1 2016