org.apache.ignite.internal.processors.cache

## Class GridCacheProjectionImpl<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheProjectionImpl<K,V>

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

    public class GridCacheProjectionImpl<K,V>
    extends Object
    implements GridCacheProjectionEx<K,V>, Externalizable

Cache projection.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridCacheProjectionImpl()` Empty constructor required for `Externalizable`.
`GridCacheProjectionImpl(CacheProjection<K,V> parent, GridCacheContext<K,V> cctx, CacheEntryPredicate entryFilter, Set<CacheFlag> flags, UUID subjId, boolean keepPortable, javax.cache.expiry.ExpiryPolicy expiryPlc)`

### Method Summary

Methods
`<K1,V1> GridCache<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` `clear(long timeout)` Clears cache on all nodes that store it's data.
`void` `clearAll(Set<K> keys)` Clears keys on all nodes that store it's data.
`IgniteInternalFuture<?>` `clearAsync()`
`IgniteInternalFuture<?>` `clearAsync(K key)`
`IgniteInternalFuture<?>` `clearAsync(Set<K> keys)`
`void` `clearLocally()` 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<K> keys)` Clears entries from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction.
`boolean` `containsKey(K key)`
`IgniteInternalFuture<Boolean>` `containsKeyAsync(K key)`
`boolean` `containsKeys(Collection<? extends K> keys)`
`IgniteInternalFuture<Boolean>` `containsKeysAsync(Collection<? extends K> keys)`
`boolean` `containsValue(V val)` Returns `true` if this cache contains given value.
`GridCacheContext<K,V>` `context()` Gets cache context.
`boolean` `deserializePortables()`
`javax.cache.Cache.Entry<K,V>` `entry(K key)` Gets entry from cache with the specified key.
`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()` Attempts to evict all cache entries.
`void` `evictAll(Collection<? extends K> keys)` Attempts to evict all entries associated with keys.
`javax.cache.expiry.ExpiryPolicy` `expiry()`
`Set<CacheFlag>` `flags()` Gets cache flags enabled on this projection.
`CacheProjection<K,V>` `flagsOff(CacheFlag[] flags)` Gets cache projection base on this but with the specified flags turned off.
`CacheProjection<K,V>` `flagsOn(CacheFlag[] flags)` Gets cache projection base on this one, but with the specified flags turned on.
`GridCacheProjectionEx<K,V>` `forSubjectId(UUID subjId)` Creates projection for specified subject ID.
`V` `get(K key)` Retrieves value mapped to the specified key from cache.
`V` `get(K key, GridCacheEntryEx entry, boolean deserializePortable, CacheEntryPredicate... filter)`
`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(List<K> keys)` Gets values from cache.
`IgniteInternalFuture<Map<K,V>>` `getAllOutTxAsync(List<K> keys)` Asynchronously gets values from cache.
`IgniteInternalFuture<V>` `getAsync(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.
`int` `globalPrimarySize()` Gets the number of all primary entries cached across all nodes (excluding backups).
`int` `globalSize()` Gets the number of all entries cached across all nodes.
`ClusterGroup` `gridProjection()` Gets grid projection for this cache.
`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(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` `isKeepPortable()`
`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.
`Iterator<javax.cache.Cache.Entry<K,V>>` `iterator()`
`<K1,V1> CacheProjection<K1,V1>` `keepPortable()` Creates projection that will operate with portable objects.
`Set<K>` `keySet()` Set of keys cached on this node.
`Set<K>` `keySet(CacheEntryPredicate... filter)` Set of keys cached on this node.
`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.
`V` `localPeek(K key, CachePeekMode[] peekModes, IgniteCacheExpiryPolicy plc)`
`void` `localRemoveAll()`
`int` `localSize(CachePeekMode[] peekModes)`
`boolean` `lock(K key, long timeout, CacheEntryPredicate... filter)` 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, CacheEntryPredicate[] filter)` All or nothing synchronous lock for passed in keys.
`IgniteInternalFuture<Boolean>` `lockAllAsync(Collection<? extends K> keys, long timeout, CacheEntryPredicate[] filter)` All or nothing synchronous lock for passed in keys.
`IgniteInternalFuture<Boolean>` `lockAsync(K key, long timeout, CacheEntryPredicate[] filter)` 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.
`V` `peek(K key)` Peeks at in-memory cached value using default `GridCachePeekMode.SMART` peek mode.
`V` `peek(K key, Collection<GridCachePeekMode> modes)` Peeks at cached value using optional set of peek modes.
`CacheEntryPredicate` `predicate()` Gets predicate on which this projection is based on or `null` if predicate is not defined.
`Set<javax.cache.Cache.Entry<K,V>>` `primaryEntrySet()` Gets set of cache entries for which this node is primary.
`Set<javax.cache.Cache.Entry<K,V>>` `primaryEntrySetx(CacheEntryPredicate... filter)` Gets set of primary entries containing internal entries.
`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.
`Collection<V>` `primaryValues()` Collection of cached values for which this node is primary.
`CacheProjection<K,V>` `projection(CacheEntryPredicate filter)` Gets cache projection based on given entry filter.
`<K1,V1> CacheProjection<K1,V1>` `projection(Class<? super K1> keyType, Class<? super V1> valType)` Gets cache projection only for given key and value type.
`V` `promote(K key)` This method promotes cache entry by given key, if any, from offheap or swap storage into memory.
`void` `promoteAll(Collection<? extends K> keys)` This method unswaps cache entries by given keys, if any, from swap storage into memory.
`V` `put(K key, V val, CacheEntryPredicate[] filter)` Stores given key-value pair in cache.
`V` `put(K key, V val, GridCacheEntryEx entry, long ttl, CacheEntryPredicate... filter)` Internal method that is called from `CacheEntryImpl`.
`void` `putAll(Map<? extends K,? extends V> m, CacheEntryPredicate[] filter)` Stores given key-value pairs in cache.
`IgniteInternalFuture<?>` `putAllAsync(Map<? extends K,? extends V> m, CacheEntryPredicate[] filter)` 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<V>` `putAsync(K key, V val, CacheEntryPredicate[] filter)` Asynchronously stores given key-value pair in cache.
`IgniteInternalFuture<V>` `putAsync(K key, V val, GridCacheEntryEx entry, long ttl, CacheEntryPredicate[] filter)` Internal method that is called from `CacheEntryImpl`.
`V` `putIfAbsent(K key, V val)` Stores given key-value pair in cache only if cache had no previous mapping for it.
`IgniteInternalFuture<V>` `putIfAbsentAsync(K key, V val)` Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.
`boolean` `putx(K key, V val, CacheEntryPredicate[] filter)` Stores given key-value pair in cache.
`boolean` `putx(K key, V val, GridCacheEntryEx entry, long ttl, CacheEntryPredicate... filter)` Internal method that is called from `CacheEntryImpl`.
`IgniteInternalFuture<Boolean>` `putxAsync(K key, V val, CacheEntryPredicate[] filter)` Stores given key-value pair in cache.
`IgniteInternalFuture<Boolean>` `putxAsync(K key, V val, GridCacheEntryEx entry, long ttl, CacheEntryPredicate[] filter)` Internal method that is called from `CacheEntryImpl`.
`boolean` `putxIfAbsent(K key, V val)` Stores given key-value pair in cache only if cache had no previous mapping for it.
`IgniteInternalFuture<Boolean>` `putxIfAbsentAsync(K key, V val)` Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.
`CacheQueries<K,V>` `queries()` Returns queries facade responsible for creating various SQL, TEXT, or SCAN queries.
`void` `readExternal(ObjectInput in)`
`V` `reload(K key)` Reloads a single key from persistent storage.
`IgniteInternalFuture<V>` `reloadAsync(K key)` Asynchronously reloads a single key from persistent storage.
`V` `remove(K key, CacheEntryPredicate[] filter)` Removes given key mapping from cache.
`V` `remove(K key, GridCacheEntryEx entry, CacheEntryPredicate... filter)` Internal method that is called from `CacheEntryImpl`.
`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 for entries for which the optionally passed in filters do pass.
`void` `removeAll(Collection<? extends K> keys, CacheEntryPredicate... filter)` Removes given key mappings from cache for entries for which the optionally passed in filters do pass.
`IgniteInternalFuture<?>` `removeAllAsync()`
`IgniteInternalFuture<?>` `removeAllAsync(Collection<? extends K> keys, CacheEntryPredicate[] filter)` Asynchronously removes given key mappings from cache for entries for which the optionally passed in filters do pass.
`void` `removeAllConflict(Map<KeyCacheObject,GridCacheVersion> drMap)` Removes DR data.
`IgniteInternalFuture<?>` `removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> drMap)` Removes DR data asynchronously.
`IgniteInternalFuture<V>` `removeAsync(K key, CacheEntryPredicate[] filter)` Asynchronously removes given key mapping from cache.
`IgniteInternalFuture<V>` `removeAsync(K key, GridCacheEntryEx entry, CacheEntryPredicate... filter)` Internal method that is called from `CacheEntryImpl`.
`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` `removex(K key, CacheEntryPredicate[] filter)` Removes given key mapping from cache.
`boolean` `removex(K key, GridCacheEntryEx entry, CacheEntryPredicate... filter)` Internal method that is called from `CacheEntryImpl`.
`GridCacheReturn` `removex(K key, V val)` Removes given key mapping from cache if one exists and value is equal to the passed in value.
`IgniteInternalFuture<Boolean>` `removexAsync(K key, CacheEntryPredicate[] filter)` Asynchronously removes given key mapping from cache.
`IgniteInternalFuture<Boolean>` `removexAsync(K key, GridCacheEntryEx entry, CacheEntryPredicate... filter)` Internal method that is called from `CacheEntryImpl`.
`IgniteInternalFuture<GridCacheReturn>` `removexAsync(K key, V val)` Asynchronously removes given key mapping from cache if one exists and value is equal to the passed in value.
`V` `replace(K key, V val)` Stores given key-value pair in cache 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<V>` `replaceAsync(K key, V val)` Asynchronously stores given key-value pair in cache 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.
`boolean` `replacex(K key, V val)` Stores given key-value pair in cache only if only if there is a previous mapping for it.
`GridCacheReturn` `replacex(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>` `replacexAsync(K key, V val)` Asynchronously stores given key-value pair in cache only if only if there is a previous mapping for it.
`IgniteInternalFuture<GridCacheReturn>` `replacexAsync(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.
`int` `size()` Gets the number of all entries cached on this node.
`int` `size(CachePeekMode[] peekModes)`
`IgniteInternalFuture<Integer>` `sizeAsync(CachePeekMode[] peekModes)`
`UUID` `subjectId()` Gets client ID for which this projection was created.
`ConcurrentMap<K,V>` `toMap()` Converts this API into standard Java `ConcurrentMap` interface.
`String` `toString()`
`Transaction` `tx()` Gets transaction started by this thread or `null` if this thread does not have a transaction.
`Transaction` `txStart()` Starts transaction with default isolation, concurrency, timeout, and invalidation policy.
`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, CacheEntryPredicate[] filter)` Unlocks given key only if current thread owns the lock.
`void` `unlockAll(Collection<? extends K> keys, CacheEntryPredicate[] filter)` Unlocks given keys only if current thread owns the locks.
`Collection<V>` `values()` Collection of values cached on this node.
`GridCacheProjectionEx<K,V>` `withExpiryPolicy(javax.cache.expiry.ExpiryPolicy plc)`
`void` `writeExternal(ObjectOutput out)`

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

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

### Constructor Detail

#### GridCacheProjectionImpl

    public GridCacheProjectionImpl()

Empty constructor required for `Externalizable`.

#### GridCacheProjectionImpl

    public GridCacheProjectionImpl(CacheProjection<K,V> parent,
                           GridCacheContext<K,V> cctx,
                           @Nullable
                           CacheEntryPredicate entryFilter,
                           @Nullable
                           Set<CacheFlag> flags,
                           @Nullable
                           UUID subjId,
                           boolean keepPortable,
                           @Nullable
                           javax.cache.expiry.ExpiryPolicy expiryPlc)

Parameters:
  `parent` - Parent projection.
  `cctx` - Cache context.
  `entryFilter` - Entry filter.
  `flags` - Flags for new projection

### Method Detail

#### context

    public GridCacheContext<K,V> context()

Gets cache context.

Specified by:
  `context` in interface `GridCacheProjectionEx<K,V>`
Returns:
  Cache context.

#### isKeepPortable

    public boolean isKeepPortable()

Returns:
  Keep portable flag.

#### deserializePortables

    public boolean deserializePortables()

Returns:
  `True` if portables should be deserialized.

#### cache

    public <K1,V1> GridCache<K1,V1> cache()

Gets base cache for this projection.

Specified by:
  `cache` in interface `CacheProjection<K,V>`
Type Parameters:
  `K1` - Cache key type.
  `V1` - Cache value type.
Returns:
  Base cache for this projection.

#### queries

    public CacheQueries<K,V> queries()

Returns queries facade responsible for creating various SQL, TEXT, or SCAN queries.

Specified by:
  `queries` in interface `CacheProjection<K,V>`
Returns:
  Queries facade responsible for creating various SQL, TEXT, or SCAN queries.

#### forSubjectId

    public GridCacheProjectionEx<K,V> forSubjectId(UUID subjId)

Creates projection for specified subject ID.

Specified by:
  `forSubjectId` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `subjId` - Client ID.
Returns:
  Internal projection.

#### subjectId

    @Nullable
    public UUID subjectId()

Gets client ID for which this projection was created.

Returns:
  Client ID.

#### projection

    public <K1,V1> CacheProjection<K1,V1> projection(Class<? super K1> keyType,
                                            Class<? super V1> valType)

Gets cache projection only for given key and value type. Only `non-null` key-value pairs that have matching key and value pairs will be used in this projection.

Specified by:
  `projection` in interface `CacheProjection<K,V>`
Type Parameters:
  `K1` - Key type.
  `V1` - Value type.
Parameters:
  `keyType` - Key type.
  `valType` - Value type.
Returns:
  Cache projection for given key and value types.

#### projection

    public CacheProjection<K,V> projection(CacheEntryPredicate filter)

Gets cache projection based on given entry filter. This filter will be simply passed through to all cache operations on this projection. Unlike `projection(org.apache.ignite.lang.IgniteBiPredicate)` method, this filter will not be used for pre-filtering.

Specified by:
  `projection` in interface `CacheProjection<K,V>`
Parameters:
  `filter` - Filter to be passed through to all cache operations. If `null`, then the same projection is returned. If cache operation receives its own filter, then filters will be `'anded'`.
Returns:
  Projection based on given filter.

#### flagsOn

    public CacheProjection<K,V> flagsOn(@Nullable
                               CacheFlag[] flags)

Gets cache projection base on this one, but with the specified flags turned on.

# Cache Flags

The resulting projection will inherit all the flags from this projection.

Specified by:
  `flagsOn` in interface `CacheProjection<K,V>`
Parameters:
  `flags` - Flags to turn on (if empty, then no-op).
Returns:
  New projection based on this one, but with the specified flags turned on.

#### flagsOff

    public CacheProjection<K,V> flagsOff(@Nullable
                                CacheFlag[] flags)

Gets cache projection base on this but with the specified flags turned off.

# Cache Flags

The resulting projection will inherit all the flags from this projection except for the ones that were turned off.

Specified by:
  `flagsOff` in interface `CacheProjection<K,V>`
Parameters:
  `flags` - Flags to turn off (if empty, then all flags will be turned off).
Returns:
  New projection based on this one, but with the specified flags turned off.

#### keepPortable

    public <K1,V1> CacheProjection<K1,V1> keepPortable()

Creates projection that will operate with portable objects.

Projection returned by this method will force cache not to deserialize portable 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.portables.PortableObject` for portable 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 portable)

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

     CacheProjection<Integer, GridPortableObject> prj = cache.keepPortable();

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

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

Specified by:
  `keepPortable` in interface `CacheProjection<K,V>`
Returns:
  Projection for portable objects.

#### size

    public int size()

Gets the number of all entries cached on this node. This method will return the count of all cache entries and has O(1) complexity on base `GridCache` projection. It is essentially the size of cache key set and is semantically identical to {`Cache.keySet().size()`.

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

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

#### localSize

    public int localSize(CachePeekMode[] peekModes)
                  throws IgniteCheckedException

Specified by:
  `localSize` in interface `CacheProjection<K,V>`
Parameters:
  `peekModes` - Peek modes.
Returns:
  Local cache size.
Throws:
  `IgniteCheckedException` - If failed.

#### size

    public int size(CachePeekMode[] peekModes)
             throws IgniteCheckedException

Specified by:
  `size` in interface `CacheProjection<K,V>`
Parameters:
  `peekModes` - Peek modes.
Returns:
  Global cache size.
Throws:
  `IgniteCheckedException` - If failed.

#### sizeAsync

    public IgniteInternalFuture<Integer> sizeAsync(CachePeekMode[] peekModes)

Specified by:
  `sizeAsync` in interface `CacheProjection<K,V>`
Parameters:
  `peekModes` - Peek modes.
Returns:
  Future.

#### globalSize

    public int globalSize()
                   throws IgniteCheckedException

Gets the number of all entries cached across all nodes.

NOTE: this operation is distributed and will query all participating nodes for their cache sizes.

Specified by:
  `globalSize` in interface `CacheProjection<K,V>`
Returns:
  Total cache size across all nodes.
Throws:
  `IgniteCheckedException`

#### globalPrimarySize

    public int globalPrimarySize()
                          throws IgniteCheckedException

Gets the number of all primary entries cached across all nodes (excluding backups).

NOTE: this operation is distributed and will query all participating nodes for their primary cache sizes.

Specified by:
  `globalPrimarySize` in interface `CacheProjection<K,V>`
Returns:
  Total primary cache size across all nodes.
Throws:
  `IgniteCheckedException`

#### nearSize

    public int nearSize()

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

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

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

#### primarySize

    public int primarySize()

Gets the number of all primary entries cached on this node. For `CacheMode.LOCAL` non-distributed cache mode, this method is identical to `CacheProjection.size()`.

For `CacheMode.PARTITIONED` and `CacheMode.REPLICATED` modes, this method will return number of primary entries cached on this node (excluding any backups). The complexity of this method is O(P), where P is the total number of partitions.

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

Specified by:
  `primarySize` in interface `CacheProjection<K,V>`
Returns:
  Number of primary entries in cache.

#### isEmpty

    public boolean isEmpty()

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

Specified by:
  `isEmpty` in interface `CacheProjection<K,V>`
Returns:
  `true` if this map contains no key-value mappings.

#### containsKey

    public boolean containsKey(K key)

Specified by:
  `containsKey` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key.
Returns:
  `True` if cache contains mapping for a given key.

#### containsKeyAsync

    public IgniteInternalFuture<Boolean> containsKeyAsync(K key)

Specified by:
  `containsKeyAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key.
Returns:
  Future.

#### containsKeys

    public boolean containsKeys(Collection<? extends K> keys)

Specified by:
  `containsKeys` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys,
Returns:
  `True` if cache contains all keys.

#### containsKeysAsync

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

Specified by:
  `containsKeysAsync` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys to check.
Returns:
  Future.

#### containsValue

    public boolean containsValue(V val)

Returns `true` if this cache contains given value.

Specified by:
  `containsValue` in interface `CacheProjection<K,V>`
Parameters:
  `val` - Value to check.
Returns:
  `True` if given value is present in cache.

#### reload

    public V reload(K key)
             throws IgniteCheckedException

Reloads a single key from persistent storage. This method delegates to `CacheStore#load(Transaction, Object)` method.

## Transactions

This method does not participate in transactions, however it does not violate cache integrity and can be used safely with or without transactions.

Specified by:
  `reload` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to reload.
Returns:
  Reloaded value or current value if entry was updated while reloading.
Throws:
  `IgniteCheckedException` - If reloading failed.

#### reloadAsync

    public IgniteInternalFuture<V> reloadAsync(K key)

Asynchronously reloads a single key from persistent storage. This method delegates to `CacheStore#load(Transaction, Object)` method.

## Transactions

This method does not participate in transactions, however it does not violate cache integrity and can be used safely with or without transactions.

Specified by:
  `reloadAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to reload.
Returns:
  Future to be completed whenever the entry is reloaded.

#### get

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

## Cache Flags

This method is not available if `CacheFlag.LOCAL` flag is set on projection.

Specified by:
  `get` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to retrieve the value for.
Returns:
  Value for the given key.
Throws:
  `IgniteCheckedException` - If get operation failed.

#### get

    public V get(K key,
        @Nullable
        GridCacheEntryEx entry,
        boolean deserializePortable,
        @Nullable
        CacheEntryPredicate... filter)
          throws IgniteCheckedException

Specified by:
  `get` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key to retrieve the value for.
  `entry` - Cached entry when called from entry wrapper.
  `filter` - Filter to check prior to getting the value. Note that filter check together with getting the value is an atomic operation.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### getAsync

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

## Cache Flags

This method is not available if `CacheFlag.LOCAL` flag is set on projection.

Specified by:
  `getAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key for the value to get.
Returns:
  Future for the get operation.

#### getForcePrimary

    public V getForcePrimary(K key)
                      throws IgniteCheckedException

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

Specified by:
  `getForcePrimary` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key to get value for.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### getForcePrimaryAsync

    public IgniteInternalFuture<V> getForcePrimaryAsync(K key)

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

Specified by:
  `getForcePrimaryAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key to get value for.
Returns:
  Future with result.

#### getAllOutTx

    @Nullable
    public Map<K,V> getAllOutTx(List<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.

Specified by:
  `getAllOutTx` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `keys` - Keys to get values for.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### getAllOutTxAsync

    public IgniteInternalFuture<Map<K,V>> getAllOutTxAsync(List<K> keys)

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

Specified by:
  `getAllOutTxAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `keys` - Keys to get values for.
Returns:
  Future with result.

#### isIgfsDataCache

    public boolean isIgfsDataCache()

Checks whether this cache is IGFS data cache.

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

#### igfsDataSpaceUsed

    public long igfsDataSpaceUsed()

Get current amount of used IGFS space in bytes.

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

#### igfsDataSpaceMax

    public long igfsDataSpaceMax()

Get maximum space available for IGFS.

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

#### isMongoDataCache

    public boolean isMongoDataCache()

Checks whether this cache is Mongo data cache.

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

#### isMongoMetaCache

    public boolean isMongoMetaCache()

Checks whether this cache is Mongo meta cache.

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

#### getAll

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

## Cache Flags

This method is not available if `CacheFlag.LOCAL` flag is set on projection.

Specified by:
  `getAll` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys to get.
Returns:
  Map of key-value pairs.
Throws:
  `IgniteCheckedException` - If get operation failed.

#### getAllAsync

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

## Cache Flags

This method is not available if `CacheFlag.LOCAL` flag is set on projection.

Specified by:
  `getAllAsync` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Key for the value to get.
Returns:
  Future for the get operation.

#### put

    public V put(K key,
        V val,
        @Nullable
        CacheEntryPredicate[] filter)
          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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `put` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
  `filter` - Optional filter to check prior to putting value in cache. Note that filter check is atomic with put operation.
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:
  `IgniteCheckedException` - If put operation failed.

#### put

    public V put(K key,
        V val,
        @Nullable
        GridCacheEntryEx entry,
        long ttl,
        @Nullable
        CacheEntryPredicate... filter)
          throws IgniteCheckedException

Internal method that is called from `CacheEntryImpl`.

Specified by:
  `put` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key.
  `val` - Value.
  `entry` - Cached entry. If not provided, equivalent to {CacheProjection#put}.
  `ttl` - Optional time-to-live. If negative, leaves ttl value unchanged.
  `filter` - Optional filter.
Returns:
  Previous value.
Throws:
  `IgniteCheckedException` - If failed.

#### putAsync

    public IgniteInternalFuture<V> putAsync(K key,
                                   V val,
                                   @Nullable
                                   CacheEntryPredicate[] filter)

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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `putAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
  `filter` - Optional filter to check prior to putting value in cache. Note that filter check is atomic with put operation.
Returns:
  Future for the put operation.

#### putAsync

    public IgniteInternalFuture<V> putAsync(K key,
                                   V val,
                                   @Nullable
                                   GridCacheEntryEx entry,
                                   long ttl,
                                   @Nullable
                                   CacheEntryPredicate[] filter)

Internal method that is called from `CacheEntryImpl`.

Specified by:
  `putAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key.
  `val` - Value.
  `entry` - Optional cached entry.
  `ttl` - Optional time-to-live value. If negative, leaves ttl value unchanged.
  `filter` - Optional filter.
Returns:
  Put operation future.

#### putx

    public boolean putx(K key,
               V val,
               @Nullable
               GridCacheEntryEx entry,
               long ttl,
               @Nullable
               CacheEntryPredicate... filter)
                 throws IgniteCheckedException

Internal method that is called from `CacheEntryImpl`.

Specified by:
  `putx` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key.
  `val` - Value.
  `entry` - Cached entry. If not provided, equivalent to {CacheProjection#put}.
  `ttl` - Optional time-to-live. If negative, leaves ttl value unchanged.
  `filter` - Optional filter.
Returns:
  Previous value.
Throws:
  `IgniteCheckedException` - If failed.

#### putx

    public boolean putx(K key,
               V val,
               @Nullable
               CacheEntryPredicate[] filter)
                 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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `putx` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
  `filter` - Optional filter to check prior to putting value in cache. Note that filter check is atomic with put operation.
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:
  `IgniteCheckedException` - If put operation failed.

#### putAllConflict

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

Store DR data.

Specified by:
  `putAllConflict` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `drMap` - DR map.
Throws:
  `IgniteCheckedException` - If put operation failed.

#### putAllConflictAsync

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

Store DR data asynchronously.

Specified by:
  `putAllConflictAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `drMap` - DR map.
Returns:
  Future.
Throws:
  `IgniteCheckedException` - If put operation failed.

#### invoke

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

Specified by:
  `invoke` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Invoke result.
Throws:
  `IgniteCheckedException` - If failed.

#### invokeAll

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

Specified by:
  `invokeAll` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `keys` - Keys.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Invoke results.
Throws:
  `IgniteCheckedException` - If failed.

#### invokeAsync

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

Specified by:
  `invokeAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Future.

#### invokeAllAsync

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

Specified by:
  `invokeAllAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `keys` - Keys.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Future.

#### invokeAll

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

Specified by:
  `invokeAll` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `map` - Map containing keys and entry processors to be applied to values.
  `args` - Arguments.
Returns:
  Invoke results.
Throws:
  `IgniteCheckedException` - If failed.

#### invokeAllAsync

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

Specified by:
  `invokeAllAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `map` - Map containing keys and entry processors to be applied to values.
  `args` - Arguments.
Returns:
  Future.

#### putxAsync

    public IgniteInternalFuture<Boolean> putxAsync(K key,
                                          V val,
                                          @Nullable
                                          CacheEntryPredicate[] filter)

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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `putxAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
  `filter` - Optional filter to check prior to putting value in cache. Note that filter check is atomic with put operation.
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.

#### putxAsync

    public IgniteInternalFuture<Boolean> putxAsync(K key,
                                          V val,
                                          @Nullable
                                          GridCacheEntryEx entry,
                                          long ttl,
                                          @Nullable
                                          CacheEntryPredicate[] filter)

Internal method that is called from `CacheEntryImpl`.

Specified by:
  `putxAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key.
  `val` - Value.
  `entry` - Cached entry. If not provided, equivalent to {CacheProjection#put}.
  `ttl` - Optional time-to-live. If negative, leave ttl value unchanged.
  `filter` - Optional filter.
Returns:
  Putx operation future.

#### putIfAbsent

    public V putIfAbsent(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 `CacheProjection.putxIfAbsent(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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `putIfAbsent` in interface `CacheProjection<K,V>`
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:
  `IgniteCheckedException` - If put operation failed.

#### putIfAbsentAsync

    public IgniteInternalFuture<V> putIfAbsentAsync(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 `CacheProjection.putxIfAbsentAsync(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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `putIfAbsentAsync` in interface `CacheProjection<K,V>`
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.

#### putxIfAbsent

    public boolean putxIfAbsent(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 `CacheProjection.putIfAbsent(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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `putxIfAbsent` in interface `CacheProjection<K,V>`
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:
  `IgniteCheckedException` - If put operation failed.

#### putxIfAbsentAsync

    public IgniteInternalFuture<Boolean> putxIfAbsentAsync(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 `CacheProjection.putIfAbsent(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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `putxIfAbsentAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Future for this put operation.

#### replace

    public V replace(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 `CacheProjection.replacex(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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `replace` in interface `CacheProjection<K,V>`
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:
  `IgniteCheckedException` - If replace operation failed.

#### replaceAsync

    public IgniteInternalFuture<V> replaceAsync(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 `CacheProjection.replacex(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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `replaceAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Future for replace operation.

#### replacex

    public boolean replacex(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 `CacheProjection.replace(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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `replacex` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  `True` if replace happened, `false` otherwise.
Throws:
  `IgniteCheckedException` - If replace operation failed.

#### replacexAsync

    public IgniteInternalFuture<Boolean> replacexAsync(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 `CacheProjection.replaceAsync(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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `replacexAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to store in cache.
  `val` - Value to be associated with the given key.
Returns:
  Future for the replace operation.

#### replace

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `replace` in interface `CacheProjection<K,V>`
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:
  `IgniteCheckedException` - If replace operation failed.

#### replaceAsync

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `replaceAsync` in interface `CacheProjection<K,V>`
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.

#### putAll

    public void putAll(Map<? extends K,? extends V> m,
              @Nullable
              CacheEntryPredicate[] filter)
                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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `putAll` in interface `CacheProjection<K,V>`
Parameters:
  `m` - Key-value pairs to store in cache.
  `filter` - Optional entry filter. If provided, then entry will be stored only if the filter returned `true`.
Throws:
  `IgniteCheckedException` - If put operation failed.

#### putAllAsync

    public IgniteInternalFuture<?> putAllAsync(Map<? extends K,? extends V> m,
                                      @Nullable
                                      CacheEntryPredicate[] filter)

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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `putAllAsync` in interface `CacheProjection<K,V>`
Parameters:
  `m` - Key-value pairs to store in cache.
  `filter` - Optional entry filter. If provided, then entry will be stored only if the filter returned `true`.
Returns:
  Future for putAll operation.

#### keySet

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

Specified by:
  `keySet` in interface `CacheProjection<K,V>`
Returns:
  Key set for this cache projection.

#### keySet

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

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.

Specified by:
  `keySet` in interface `CacheProjection<K,V>`
Parameters:
  `filter` - Optional filter to check prior to getting key form cache. Note that filter is checked atomically together with get operation.
Returns:
  Key set for this cache projection.

#### primaryKeySet

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

Specified by:
  `primaryKeySet` in interface `CacheProjection<K,V>`
Returns:
  Primary key set for the current node.

#### values

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

Specified by:
  `values` in interface `CacheProjection<K,V>`
Returns:
  Collection of cached values.

#### primaryValues

    public Collection<V> primaryValues()

Collection of cached values for which this node is primary. This collection is dynamic and may change with grid topology changes. Note that this collection will not contain values that are `null` because they were invalided. 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.

Specified by:
  `primaryValues` in interface `CacheProjection<K,V>`
Returns:
  Collection of primary cached values for the current node.

#### entrySet

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

Specified by:
  `entrySet` in interface `CacheProjection<K,V>`
Returns:
  Entries that pass through key filter.

#### entrySetx

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

Gets entry set containing internal entries.

Specified by:
  `entrySetx` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `filter` - Filter.
Returns:
  Entry set.

#### primaryEntrySetx

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

Gets set of primary entries containing internal entries.

Specified by:
  `primaryEntrySetx` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `filter` - Optional filter.
Returns:
  Primary entry set.

#### entrySet

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

Gets set containing cache entries that belong to provided partition or `null` if partition is not found locally.

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

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

#### primaryEntrySet

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

Gets set of cache entries for which this node is primary. This set is dynamic and may change with grid topology changes. 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.

Specified by:
  `primaryEntrySet` in interface `CacheProjection<K,V>`
Returns:
  Primary cache entries that pass through key filter.

#### flags

    public Set<CacheFlag> flags()

Gets cache flags enabled on this projection.

Specified by:
  `flags` in interface `CacheProjection<K,V>`
Returns:
  Flags for this projection (empty set if no flags have been set).

#### predicate

    public CacheEntryPredicate predicate()

Gets predicate on which this projection is based on or `null` if predicate is not defined.

Specified by:
  `predicate` in interface `GridCacheProjectionEx<K,V>`
Returns:
  Filter on which this projection is based on.

#### name

    public String name()

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

Specified by:
  `name` in interface `CacheProjection<K,V>`
Returns:
  Cache name.

#### gridProjection

    public ClusterGroup gridProjection()

Gets grid projection for this cache. This projection includes all nodes which have this cache configured.

Specified by:
  `gridProjection` in interface `CacheProjection<K,V>`
Returns:
  Projection instance.

#### peek

    public V peek(K key)

Peeks at in-memory cached value using default `GridCachePeekMode.SMART` peek mode.

This method will not load value from any persistent store or from a remote node.

## Transactions

This method does not participate in any transactions, however, it will peek at transactional value according to the `GridCachePeekMode.SMART` mode semantics. If you need to look at global cached value even from within transaction, you can use `CacheProjection.peek(Object, Collection)` method.

Specified by:
  `peek` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Entry key.
Returns:
  Peeked value.

#### localPeek

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

Specified by:
  `localPeek` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key.
  `peekModes` - Peek modes.
  `plc` - Expiry policy if TTL should be updated.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### localEntries

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

Specified by:
  `localEntries` in interface `CacheProjection<K,V>`
Parameters:
  `peekModes` - Peek modes.
Returns:
  Entries iterable.
Throws:
  `IgniteCheckedException` - If failed.

#### peek

    public V peek(K key,
         @Nullable
         Collection<GridCachePeekMode> modes)
           throws IgniteCheckedException

Peeks at cached value using optional set of peek modes. This method will sequentially iterate over given peek modes in the order passed in, and try to peek at value using each peek mode. Once a `non-null` value is found, it will be immediately returned.

Note that if modes are not provided this method works exactly the same way as `CacheProjection.peek(Object)`, implicitly using `GridCachePeekMode.SMART` mode.

## Transactions

This method does not participate in any transactions, however, it may peek at transactional value depending on the peek modes used.

Specified by:
  `peek` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Entry key.
  `modes` - Optional set of peek modes.
Returns:
  Peeked value.
Throws:
  `IgniteCheckedException` - If peek operation failed.

#### entry

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

Gets entry from cache with the specified key. The returned entry can be used even after entry key has been removed from cache. In that case, every operation on returned entry will result in creation of a new entry.

Note that this method can return `null` if projection is configured as pre-filtered and entry key and value don't pass key-value filter of the projection.

Specified by:
  `entry` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Entry key.
Returns:
  Cache entry or `null` if projection pre-filtering was not passed.

#### evict

    public boolean evict(K key)

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

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.READ`.

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

#### evictAll

    public 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` and `CacheFlag.SKIP_SWAP` is not enabled, the evicted entry will be swapped to offheap, and then to disk.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.READ`.

Specified by:
  `evictAll` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys to evict.

#### evictAll

    public void evictAll()

Attempts to evict all cache entries. 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` and `CacheFlag.SKIP_SWAP` is not enabled, the evicted entry will be swapped to offheap, and then to disk.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.READ`.

Specified by:
  `evictAll` in interface `CacheProjection<K,V>`

#### clearLocally

    public void clearLocally()

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` and `CacheFlag.SKIP_SWAP` is not enabled, 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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.READ`.

Specified by:
  `clearLocally` in interface `CacheProjection<K,V>`

#### clearLocallyAll

    public void clearLocallyAll(Set<K> keys)

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` and `CacheFlag.SKIP_SWAP` is not enabled, 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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.READ`.

Specified by:
  `clearLocallyAll` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys to clearLocally.

#### clear

    public 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 `CacheProjection.clearLocally()` 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.

This method is identical to calling `clear(0)`.

Specified by:
  `clear` in interface `CacheProjection<K,V>`
Throws:
  `IgniteCheckedException` - In case of cache could not be cleared on any of the nodes.

#### clear

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

Specified by:
  `clear` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to clear.
Throws:
  `IgniteCheckedException` - In case of cache could not be cleared on any of the nodes.

#### clearAll

    public void clearAll(Set<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 `CacheProjection.clearLocallyAll(Set)` 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.

Specified by:
  `clearAll` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys to clear.
Throws:
  `IgniteCheckedException` - In case of cache could not be cleared on any of the nodes.

#### clearAsync

    public IgniteInternalFuture<?> clearAsync(K key)

Specified by:
  `clearAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to clear.
Returns:
  Clear future.

#### clearAsync

    public IgniteInternalFuture<?> clearAsync(Set<K> keys)

Specified by:
  `clearAsync` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys to clear.
Returns:
  Clear future.

#### clearAsync

    public IgniteInternalFuture<?> clearAsync()

Specified by:
  `clearAsync` in interface `CacheProjection<K,V>`
Returns:
  Clear future.

#### clear

    public void clear(long timeout)
               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 `CacheProjection.clearLocally()` method which only clears local node's cache.

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

Specified by:
  `clear` in interface `CacheProjection<K,V>`
Parameters:
  `timeout` - Timeout for clearLocally all task in milliseconds (0 for never). Set it to larger value for large caches.
Throws:
  `IgniteCheckedException` - In case of cache could not be cleared on any of the nodes.

#### clearLocally

    public boolean clearLocally(K key)

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

If `CacheConfiguration.isSwapEnabled()` is set to `true` and `CacheFlag.SKIP_SWAP` is not enabled, 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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.READ`.

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

#### remove

    public V remove(K key,
           @Nullable
           CacheEntryPredicate[] filter)
             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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `remove` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key whose mapping is to be removed from cache.
  `filter` - Optional filter to check prior to removing value form cache. Note that filter is checked atomically together with remove operation.
Returns:
  Previous value associated with specified key, or `null` if there was no value for this key.
Throws:
  `IgniteCheckedException` - If remove operation failed.

#### remove

    public V remove(K key,
           @Nullable
           GridCacheEntryEx entry,
           @Nullable
           CacheEntryPredicate... filter)
             throws IgniteCheckedException

Internal method that is called from `CacheEntryImpl`.

Specified by:
  `remove` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key to remove.
  `entry` - Cached entry. If not provided, equivalent to {CacheProjection#put}.
  `filter` - Optional filter.
Returns:
  Previous value.
Throws:
  `IgniteCheckedException` - If failed.

#### removeAsync

    public IgniteInternalFuture<V> removeAsync(K key,
                                      CacheEntryPredicate[] filter)

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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `removeAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key whose mapping is to be removed from cache.
  `filter` - Optional filter to check prior to removing value form cache. Note that filter is checked atomically together with remove operation.
Returns:
  Future for the remove operation.

#### removeAsync

    public IgniteInternalFuture<V> removeAsync(K key,
                                      @Nullable
                                      GridCacheEntryEx entry,
                                      @Nullable
                                      CacheEntryPredicate... filter)

Internal method that is called from `CacheEntryImpl`.

Specified by:
  `removeAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key to remove.
  `entry` - Optional cached entry.
  `filter` - Optional filter.
Returns:
  Put operation future.

#### removex

    public boolean removex(K key,
                  @Nullable
                  CacheEntryPredicate[] filter)
                    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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `removex` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key whose mapping is to be removed from cache.
  `filter` - Optional filter to check prior to removing value form cache. Note that filter is checked atomically together with remove operation.
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:
  `IgniteCheckedException` - If remove failed.

#### removeAllConflict

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

Removes DR data.

Specified by:
  `removeAllConflict` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `drMap` - DR map.
Throws:
  `IgniteCheckedException` - If remove failed.

#### removeAllConflictAsync

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

Removes DR data asynchronously.

Specified by:
  `removeAllConflictAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `drMap` - DR map.
Returns:
  Future.
Throws:
  `IgniteCheckedException` - If remove failed.

#### removex

    public boolean removex(K key,
                  @Nullable
                  GridCacheEntryEx entry,
                  @Nullable
                  CacheEntryPredicate... filter)
                    throws IgniteCheckedException

Internal method that is called from `CacheEntryImpl`.

Specified by:
  `removex` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key to remove.
  `entry` - Cached entry. If not provided, equivalent to {CacheProjection#put}.
  `filter` - Optional filter.
Returns:
  Previous value.
Throws:
  `IgniteCheckedException` - If failed.

#### removexAsync

    public IgniteInternalFuture<Boolean> removexAsync(K key,
                                             @Nullable
                                             CacheEntryPredicate[] filter)

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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `removexAsync` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key whose mapping is to be removed from cache.
  `filter` - Optional filter to check prior to removing value form cache. Note that filter is checked atomically together with remove operation.
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`.

#### removexAsync

    public IgniteInternalFuture<Boolean> removexAsync(K key,
                                             @Nullable
                                             GridCacheEntryEx entry,
                                             @Nullable
                                             CacheEntryPredicate... filter)

Internal method that is called from `CacheEntryImpl`.

Specified by:
  `removexAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key to remove.
  `entry` - Cached entry. If not provided, equivalent to {CacheProjection#put}.
  `filter` - Optional filter.
Returns:
  Putx operation future.

#### replacexAsync

    public IgniteInternalFuture<GridCacheReturn> replacexAsync(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 `CacheWriter.write(javax.cache.Cache.Entry)` method.

## Transactions

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `replacexAsync` in interface `GridCacheProjectionEx<K,V>`
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. The future will return object containing actual old value and success flag.

#### replacex

    public GridCacheReturn replacex(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 `CacheWriter.write(javax.cache.Cache.Entry)` method.

## Transactions

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `replacex` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key to store in cache.
  `oldVal` - Old value to match.
  `newVal` - Value to be associated with the given key.
Returns:
  Object containing actual old value and success flag.
Throws:
  `IgniteCheckedException` - If replace operation failed.

#### removex

    public GridCacheReturn removex(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 `CacheWriter.delete(Object)` method.

## Transactions

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `removex` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `key` - Key whose mapping is to be removed from cache.
  `val` - Value to match against currently cached value.
Returns:
  Object containing actual old value and success flag.
Throws:
  `IgniteCheckedException` - If remove failed.

#### removexAsync

    public IgniteInternalFuture<GridCacheReturn> removexAsync(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 `CacheWriter.delete(Object)` method.

## Transactions

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `removexAsync` in interface `GridCacheProjectionEx<K,V>`
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 object containing actual old value and success flag.

#### remove

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `remove` in interface `CacheProjection<K,V>`
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:
  `IgniteCheckedException` - If remove failed.

#### removeAsync

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `removeAsync` in interface `CacheProjection<K,V>`
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.

#### removeAll

    public void removeAll(@Nullable
                 Collection<? extends K> keys,
                 @Nullable
                 CacheEntryPredicate... filter)
                   throws IgniteCheckedException

Removes given key mappings from cache for entries for which the optionally passed in filters do pass.

If write-through is enabled, the values will be removed from `CacheStore` via `@link CacheStore#removeAll(Transaction, Collection)` method.

## Transactions

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `removeAll` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys whose mappings are to be removed from cache.
  `filter` - Optional filter to check prior to removing value form cache. Note that filter is checked atomically together with remove operation.
Throws:
  `IgniteCheckedException` - If remove failed.

#### removeAllAsync

    public IgniteInternalFuture<?> removeAllAsync(@Nullable
                                         Collection<? extends K> keys,
                                         @Nullable
                                         CacheEntryPredicate[] filter)

Asynchronously removes given key mappings from cache for entries for which the optionally passed in filters do pass.

If write-through is enabled, the values will be removed from `CacheStore` via `@link CacheStore#removeAll(Transaction, Collection)` method.

## Transactions

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `removeAllAsync` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys whose mappings are to be removed from cache.
  `filter` - Optional filter to check prior to removing value form cache. Note that filter is checked atomically together with remove operation.
Returns:
  Future for the remove operation. The future will complete whenever remove operation completes.

#### removeAll

    public void removeAll()
                   throws IgniteCheckedException

Removes mappings from cache for entries for which the optionally passed in filters do pass. If passed in filters are `null`, then all entries in cache will be enrolled into transaction.

USE WITH CARE - if your cache has many entries that pass through the filter or if filter is empty, then transaction will quickly become very heavy and slow. Also, locks are acquired in undefined order, so it may cause a deadlock when used with other concurrent transactional updates.

If write-through is enabled, the values will be removed from `CacheStore` via `@link CacheStore#removeAll(Transaction, Collection)` method.

## Transactions

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

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `removeAll` in interface `CacheProjection<K,V>`
Throws:
  `IgniteCheckedException` - If remove failed.

#### removeAllAsync

    public IgniteInternalFuture<?> removeAllAsync()

Specified by:
  `removeAllAsync` in interface `CacheProjection<K,V>`
Returns:
  Remove future.

#### localRemoveAll

    public void localRemoveAll()
                        throws IgniteCheckedException

Specified by:
  `localRemoveAll` in interface `CacheProjection<K,V>`
Throws:
  `IgniteCheckedException` - If failed.

#### lock

    public boolean lock(K key,
               long timeout,
               @Nullable
               CacheEntryPredicate... filter)
                 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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `lock` in interface `CacheProjection<K,V>`
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).
  `filter` - Optional filter to validate prior to acquiring the lock.
Returns:
  `True` if all filters passed and lock was acquired, `false` otherwise.
Throws:
  `IgniteCheckedException` - If lock acquisition resulted in error.

#### lockAsync

    public IgniteInternalFuture<Boolean> lockAsync(K key,
                                          long timeout,
                                          @Nullable
                                          CacheEntryPredicate[] filter)

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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `lockAsync` in interface `CacheProjection<K,V>`
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).
  `filter` - Optional filter to validate prior to acquiring the lock.
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

    public boolean lockAll(@Nullable
                  Collection<? extends K> keys,
                  long timeout,
                  @Nullable
                  CacheEntryPredicate[] filter)
                    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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `lockAll` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys to lock.
  `timeout` - Timeout in milliseconds to wait for lock to be acquired (`'0'` for no expiration).
  `filter` - Optional filter that needs to atomically pass in order for the locks to be acquired.
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

    public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable
                                             Collection<? extends K> keys,
                                             long timeout,
                                             @Nullable
                                             CacheEntryPredicate[] filter)

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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `lockAllAsync` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys to lock.
  `timeout` - Timeout in milliseconds to wait for lock to be acquired (`'0'` for no expiration).
  `filter` - Optional filter that needs to atomically pass in order for the locks to be acquired.
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

    public void unlock(K key,
              CacheEntryPredicate[] filter)
                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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `unlock` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to unlock.
  `filter` - Optional filter that needs to pass prior to unlock taking effect.
Throws:
  `IgniteCheckedException` - If unlock execution resulted in error.

#### unlockAll

    public void unlockAll(@Nullable
                 Collection<? extends K> keys,
                 @Nullable
                 CacheEntryPredicate[] filter)
                   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.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.LOCAL`, `CacheFlag.READ`.

Specified by:
  `unlockAll` in interface `CacheProjection<K,V>`
Parameters:
  `keys` - Keys to unlock.
  `filter` - Optional filter which needs to pass for individual entries to be unlocked.
Throws:
  `IgniteCheckedException` - If unlock execution resulted in error.

#### isLocked

    public boolean isLocked(K key)

Checks if any node owns a lock for this key.

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

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

#### isLockedByThread

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

Specified by:
  `isLockedByThread` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to check.
Returns:
  `True` if key is locked by current thread.

#### promote

    public V promote(K key)
              throws IgniteCheckedException

This method promotes cache entry by given key, if any, from offheap or swap storage into memory.

## Transactions

This method is not transactional.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.SKIP_SWAP`, `CacheFlag.READ`.

Specified by:
  `promote` in interface `CacheProjection<K,V>`
Parameters:
  `key` - Key to promote entry for.
Returns:
  Unswapped entry value or `null` for non-existing key.
Throws:
  `IgniteCheckedException` - If promote failed.

#### promoteAll

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

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

## Transactions

This method is not transactional.

## Cache Flags

This method is not available if any of the following flags are set on projection: `CacheFlag.SKIP_SWAP`, `CacheFlag.READ`.

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

#### txStart

    public Transaction txStart()
                        throws IllegalStateException

Starts transaction with default isolation, concurrency, timeout, and invalidation policy. All defaults are set in `CacheConfiguration` at startup.

Specified by:
  `txStart` in interface `CacheProjection<K,V>`
Returns:
  New transaction
Throws:
  `IllegalStateException` - If transaction is already started by this thread.

#### txStartEx

    public IgniteInternalTx txStartEx(TransactionConcurrency concurrency,
                             TransactionIsolation isolation)

Specified by:
  `txStartEx` in interface `CacheProjection<K,V>`
Parameters:
  `concurrency` - Concurrency.
  `isolation` - Isolation.
Returns:
  New transaction.

#### txStart

    public Transaction txStart(TransactionConcurrency concurrency,
                      TransactionIsolation isolation)

Starts new transaction with the specified concurrency and isolation.

Specified by:
  `txStart` in interface `CacheProjection<K,V>`
Parameters:
  `concurrency` - Concurrency.
  `isolation` - Isolation.
Returns:
  New transaction.

#### txStart

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

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

Specified by:
  `txStart` in interface `CacheProjection<K,V>`
Parameters:
  `concurrency` - Concurrency.
  `isolation` - Isolation.
  `timeout` - Timeout.
  `txSize` - Number of entries participating in transaction (may be approximate).
Returns:
  New transaction.

#### tx

    public Transaction tx()

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

Specified by:
  `tx` in interface `CacheProjection<K,V>`
Returns:
  Transaction started by this thread or `null` if this thread does not have a transaction.

#### toMap

    public ConcurrentMap<K,V> toMap()

Converts this API into standard Java `ConcurrentMap` interface.

Specified by:
  `toMap` in interface `CacheProjection<K,V>`
Returns:
  `ConcurrentMap` representation of given cache projection.

#### iterator

    public Iterator<javax.cache.Cache.Entry<K,V>> iterator()

Specified by:
  `iterator` in interface `Iterable<javax.cache.Cache.Entry<K,V>>`

#### expiry

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

Specified by:
  `expiry` in interface `GridCacheProjectionEx<K,V>`
Returns:
  `ExpiryPolicy` associated with this projection.

#### localLoadCache

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

Specified by:
  `localLoadCache` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `p` - Optional predicate (may be `null`). If provided, will be used to filter values to be put into cache.
  `args` - Optional user arguments to be passed into `CacheStore.loadCache(org.apache.ignite.lang.IgniteBiInClosure, Object...)` method.
Throws:
  `IgniteCheckedException` - If loading failed.

#### localLoadCacheAsync

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

Specified by:
  `localLoadCacheAsync` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `p` - Optional predicate (may be `null`). If provided, will be used to filter values to be put into cache.
  `args` - Optional user arguments to be passed into `CacheStore.loadCache(org.apache.ignite.lang.IgniteBiInClosure,Object...)` method.
Returns:
  Future to be completed whenever loading completes.

#### withExpiryPolicy

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

Specified by:
  `withExpiryPolicy` in interface `GridCacheProjectionEx<K,V>`
Parameters:
  `plc` - `ExpiryPolicy` to associate with this projection.
Returns:
  New projection based on this one, but with the specified expiry policy.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0
Release Date | : March 31 2015