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

## Class GridNearAtomicCache<K,V>

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

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

    public class GridNearAtomicCache<K,V>
    extends GridNearCacheAdapter<K,V>

Near cache for atomic cache.

See Also:
  Serialized Form

### Nested Class Summary

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

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

### Field Summary

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

`cacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, ctx, DFLT_START_CACHE_SIZE, keyCheck, lastFut, locNodeId, log, map, MAX_RETRIES, metrics, RET2NULL, txLockMsgLog`

### Constructor Summary

Constructors
Constructor and Description
`GridNearAtomicCache()` Empty constructor required for `Externalizable`.
`GridNearAtomicCache(GridCacheContext<K,V> ctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`GridDhtCacheAdapter<K,V>` `dht()`
`void` `dht(GridDhtAtomicCache<K,V> dht)`
`protected IgniteInternalFuture<Map<K,V>>` `getAllAsync(Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, UUID subjId, String taskName, boolean deserializeBinary, boolean recovery, boolean skipVals, boolean needVer)`
`V` `getAndPut(K key, V val, CacheEntryPredicate filter)`
`IgniteInternalFuture<V>` `getAndPutAsync0(K key, V val, CacheEntryPredicate filter)`
`V` `getAndRemove(K key)` Removes given key mapping from cache.
`IgniteInternalFuture<V>` `getAndRemoveAsync(K key)` Asynchronously removes given key mapping from cache.
`<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)`
`protected IgniteInternalFuture<Boolean>` `lockAllAsync(Collection<KeyCacheObject> keys, long timeout, IgniteTxLocalEx tx, boolean isInvalidate, boolean isRead, boolean retval, TransactionIsolation isolation, long createTtl, long accessTtl)`
`void` `onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)`
`List<KeyCacheObject>` `processDhtAtomicUpdateRequest(UUID nodeId, GridDhtAtomicAbstractUpdateRequest req, GridDhtAtomicNearResponse res)`
`void` `processNearAtomicUpdateResponse(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicUpdateResponse res)`
`boolean` `put(K key, V val, CacheEntryPredicate filter)`
`void` `putAll(Map<? extends K,? extends V> m)` Stores given key-value pairs in cache.
`IgniteInternalFuture<?>` `putAllAsync(Map<? extends K,? extends V> m)` Asynchronously stores given key-value pairs in cache.
`void` `putAllConflict(Map<KeyCacheObject,GridCacheDrInfo> drMap)` Store DR data.
`IgniteInternalFuture<?>` `putAllConflictAsync(Map<KeyCacheObject,GridCacheDrInfo> drMap)` Store DR data asynchronously.
`IgniteInternalFuture<Boolean>` `putAsync0(K key, V val, CacheEntryPredicate filter)`
`boolean` `remove(K key)` Removes given key mapping from cache.
`boolean` `remove(K key, CacheEntryPredicate filter)`
`void` `removeAll()` Removes mappings from cache.
`void` `removeAll(Collection<? extends K> keys)` Removes given key mappings from cache.
`IgniteInternalFuture<?>` `removeAllAsync()`
`IgniteInternalFuture<?>` `removeAllAsync(Collection<? extends K> keys)` Asynchronously removes given key mappings from cache for entries.
`void` `removeAllConflict(Map<KeyCacheObject,GridCacheVersion> drMap)` Removes DR data.
`IgniteInternalFuture<?>` `removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> drMap)` Removes DR data asynchronously.
`IgniteInternalFuture<Boolean>` `removeAsync(K key, CacheEntryPredicate filter)`
`void` `start()` Starts this cache.
`void` `unlockAll(Collection<? extends K> keys)` Unlocks given keys only if current thread owns the locks.

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

`clearLocally, clearLocallyAll, entryEx, entryExx, entrySet, evict, evictAll, forceKeyCheck, igfsDataSpaceUsed, isAllLockedNearOnly, isIgfsDataCache, isLocked, isLockedNearOnly, isMongoDataCache, isMongoMetaCache, isNear, loadAsync, localLoad, localLoadCache, localLoadCacheAsync, nearEntries, nearSize, offHeapAllocatedSize, offHeapEntriesCount, onIgfsDataSizeChanged, onReconnected, peekExx, preloader, primarySize, primarySizeLong, processGetResponse, size, sizeLong, splitClearLocally, toString`

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

`localSizeLong, localSizeLong, lockAllAsync, removeVersionedEntry, txLockAsync`

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

`active, active, affinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, awaitLastFut, cache, checkJta, clear, clear, clearAll, clearAllAsync, clearAsync, clearAsync, clearLocally, clearLocally, clusterMetrics, clusterMetrics, clusterMxBean, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, context, decrementSize, entries, entryEx, entryEx, entrySet, expiry, expiryPolicy, forSubjectId, get, get, get0, getAll, getAll0, getAllAsync, getAllAsync, getAllAsync, getAllAsync0, getAllOutTx, getAllOutTxAsync, getAndPut, getAndPut0, getAndPutAsync, getAndPutAsync, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove0, getAndRemoveAsync0, getAndReplace, getAndReplaceAsync, getAsync, getAsync, getAsync, getEntries, getEntriesAsync, getEntry, getEntryAsync, getForcePrimary, getForcePrimaryAsync, igniteIterator, igniteIterator, incrementSize, init, invoke, isColocated, isDht, isDhtAtomic, isEmpty, isLocal, isLockedByThread, iterator, iterator, keepBinary, keySet, loadAll, localEntries, localMetrics, localMxBean, localPeek, localSize, lock, lockAll, lockAsync, log, lostPartitions, map, metrics0, name, onKernalStart, onKernalStop, onUndeploy, parsePeekModes, peekEx, peekEx, printMemoryStats, put, put0, putAll0, putAllAsync0, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, readExternal, readResolve, rebalance, remove, remove0, removeAll0, removeAllAsync0, removeAsync, removeAsync, removeAsync0, removeEntry, removeIfObsolete, replace, replace, replaceAsync, replaceAsync, saveFuture, scanIterator, setSkipStore, size, sizeAsync, sizeLong, sizeLong, sizeLongAsync, sizeLongAsync, skipStore, startInfo, stop, stopInfo, tx, txStart, txStart, txStartEx, unlock, validateCacheKey, validateCacheKeys, withExpiryPolicy, withNoRetries, writeExternal`

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

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

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

`forEach, spliterator`

### Constructor Detail

#### GridNearAtomicCache

    public GridNearAtomicCache()

Empty constructor required for `Externalizable`.

#### GridNearAtomicCache

    public GridNearAtomicCache(GridCacheContext<K,V> ctx)

Parameters:
  `ctx` - Context.

### Method Detail

#### start

    public void start()
               throws IgniteCheckedException

Starts this cache. Child classes should override this method to provide custom start-up behavior.

Overrides:
  `start` in class `GridNearCacheAdapter<K,V>`
Throws:
  `IgniteCheckedException` - If start failed.

#### dht

    public void dht(GridDhtAtomicCache<K,V> dht)

Parameters:
  `dht` - DHT cache.

#### dht

    public GridDhtCacheAdapter<K,V> dht()

Specified by:
  `dht` in class `GridNearCacheAdapter<K,V>`
Returns:
  DHT cache.

#### processNearAtomicUpdateResponse

    public void processNearAtomicUpdateResponse(GridNearAtomicAbstractUpdateRequest req,
                                                GridNearAtomicUpdateResponse res)

Parameters:
  `req` - Update request.
  `res` - Update response.

#### processDhtAtomicUpdateRequest

    @Nullable
    public List<KeyCacheObject> processDhtAtomicUpdateRequest(UUID nodeId,
                                                                        GridDhtAtomicAbstractUpdateRequest req,
                                                                        GridDhtAtomicNearResponse res)

Parameters:
  `nodeId` - Sender node ID.
  `req` - Dht atomic update request.
  `res` - Dht atomic update response.
Returns:
  Evicted near keys (if any).

#### getAllAsync

    protected IgniteInternalFuture<Map<K,V>> getAllAsync(@Nullable
                                                         Collection<? extends K> keys,
                                                         boolean forcePrimary,
                                                         boolean skipTx,
                                                         @Nullable
                                                         UUID subjId,
                                                         String taskName,
                                                         boolean deserializeBinary,
                                                         boolean recovery,
                                                         boolean skipVals,
                                                         boolean needVer)

Overrides:
  `getAllAsync` in class `GridCacheAdapter<K,V>`
Parameters:
  `keys` - Keys.
  `forcePrimary` - Force primary.
  `skipTx` - Skip tx.
  `subjId` - Subj Id.
  `taskName` - Task name.
  `deserializeBinary` - Deserialize binary.
  `recovery` - Recovery mode flag.
  `skipVals` - Skip values.
  `needVer` - Need version.
Returns:
  Future for the get operation.
See Also:
  `GridCacheAdapter.getAllAsync(Collection)`

#### getAndPut

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

Overrides:
  `getAndPut` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key.
  `val` - Value.
  `filter` - Optional filter.
Returns:
  Previous value.
Throws:
  `IgniteCheckedException` - If failed.

#### put

    public boolean put(K key,
                       V val,
                       CacheEntryPredicate filter)
                throws IgniteCheckedException

Overrides:
  `put` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key.
  `val` - Value.
  `filter` - Filter.
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.

#### getAndPutAsync0

    public IgniteInternalFuture<V> getAndPutAsync0(K key,
                                                   V val,
                                                   @Nullable
                                                   CacheEntryPredicate filter)

Overrides:
  `getAndPutAsync0` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key.
  `val` - Value.
  `filter` - Optional filter.
Returns:
  Put operation future.

#### putAsync0

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

Overrides:
  `putAsync0` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key.
  `val` - Value.
  `filter` - Optional filter.
Returns:
  Putx operation future.

#### putAll

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

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

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

## Transactions

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

Specified by:
  `putAll` in interface `IgniteInternalCache<K,V>`
Overrides:
  `putAll` in class `GridCacheAdapter<K,V>`
Parameters:
  `m` - Key-value pairs to store in cache.
Throws:
  `IgniteCheckedException` - If put operation failed.

#### putAllAsync

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

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

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

## Transactions

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

Specified by:
  `putAllAsync` in interface `IgniteInternalCache<K,V>`
Overrides:
  `putAllAsync` in class `GridCacheAdapter<K,V>`
Parameters:
  `m` - Key-value pairs to store in cache.
Returns:
  Future for putAll operation.

#### putAllConflict

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

Store DR data.

Specified by:
  `putAllConflict` in interface `IgniteInternalCache<K,V>`
Overrides:
  `putAllConflict` in class `GridCacheAdapter<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 `IgniteInternalCache<K,V>`
Overrides:
  `putAllConflictAsync` in class `GridCacheAdapter<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 `IgniteInternalCache<K,V>`
Overrides:
  `invoke` in class `GridCacheAdapter<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 `IgniteInternalCache<K,V>`
Overrides:
  `invokeAll` in class `GridCacheAdapter<K,V>`
Parameters:
  `keys` - Keys.
  `entryProcessor` - Entry processor.
  `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 `IgniteInternalCache<K,V>`
Overrides:
  `invokeAllAsync` in class `GridCacheAdapter<K,V>`
Parameters:
  `map` - Map containing keys and entry processors to be applied to values.
  `args` - Arguments.
Returns:
  Future.

#### invokeAsync

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

Specified by:
  `invokeAsync` in interface `IgniteInternalCache<K,V>`
Overrides:
  `invokeAsync` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key.
  `entryProcessor` - Entry processor.
  `args` - Arguments.
Returns:
  Future.
Throws:
  `javax.cache.processor.EntryProcessorException`

#### 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 `IgniteInternalCache<K,V>`
Overrides:
  `invokeAll` in class `GridCacheAdapter<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(Set<? extends K> keys,
                                                                                                         javax.cache.processor.EntryProcessor<K,V,T> entryProcessor,
                                                                                                         Object... args)

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

#### remove

    public boolean remove(K key,
                          @Nullable
                          CacheEntryPredicate filter)
                   throws IgniteCheckedException

Overrides:
  `remove` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key.
  `filter` - Filter.
Returns:
  `True` if entry was removed.
Throws:
  `IgniteCheckedException` - If failed.

#### getAndRemove

    public V getAndRemove(K key)
                   throws IgniteCheckedException

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

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

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

## Transactions

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

Specified by:
  `getAndRemove` in interface `IgniteInternalCache<K,V>`
Overrides:
  `getAndRemove` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key whose mapping is to be removed from cache.
Returns:
  Previous value associated with specified key, or `null` if there was no value for this key.
Throws:
  `IgniteCheckedException` - If remove operation failed.

#### getAndRemoveAsync

    public IgniteInternalFuture<V> getAndRemoveAsync(K key)

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

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

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

## Transactions

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

Specified by:
  `getAndRemoveAsync` in interface `IgniteInternalCache<K,V>`
Overrides:
  `getAndRemoveAsync` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key whose mapping is to be removed from cache.
Returns:
  Future for the remove operation.

#### removeAll

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

Removes given key mappings from cache.

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

## Transactions

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

Specified by:
  `removeAll` in interface `IgniteInternalCache<K,V>`
Overrides:
  `removeAll` in class `GridCacheAdapter<K,V>`
Parameters:
  `keys` - Keys whose mappings are to be removed from cache.
Throws:
  `IgniteCheckedException` - If remove failed.

#### removeAllAsync

    public IgniteInternalFuture<?> removeAllAsync(Collection<? extends K> keys)

Asynchronously removes given key mappings from cache for entries.

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

## Transactions

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

Specified by:
  `removeAllAsync` in interface `IgniteInternalCache<K,V>`
Overrides:
  `removeAllAsync` in class `GridCacheAdapter<K,V>`
Parameters:
  `keys` - Keys whose mappings are to be removed from cache.
Returns:
  Future for the remove operation. The future will complete whenever remove operation completes.

#### remove

    public boolean remove(K key)
                   throws IgniteCheckedException

Removes given key mapping from cache.

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

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

## Transactions

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

Specified by:
  `remove` in interface `IgniteInternalCache<K,V>`
Overrides:
  `remove` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key whose mapping is to be removed from cache.
Returns:
  `True` if filter passed validation and entry was removed, `false` otherwise. Note that if filter is not specified, this method will return `true`.
Throws:
  `IgniteCheckedException` - If remove failed.

#### removeAsync

    public IgniteInternalFuture<Boolean> removeAsync(K key,
                                                     @Nullable
                                                     CacheEntryPredicate filter)

Overrides:
  `removeAsync` in class `GridCacheAdapter<K,V>`
Parameters:
  `key` - Key to remove.
  `filter` - Optional filter.
Returns:
  Putx operation future.

#### removeAll

    public void removeAll()
                   throws IgniteCheckedException

Removes mappings from cache.

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

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

## Transactions

This method is not transactional.

Specified by:
  `removeAll` in interface `IgniteInternalCache<K,V>`
Overrides:
  `removeAll` in class `GridDistributedCacheAdapter<K,V>`
Throws:
  `IgniteCheckedException` - If remove failed.

#### removeAllAsync

    public IgniteInternalFuture<?> removeAllAsync()

Specified by:
  `removeAllAsync` in interface `IgniteInternalCache<K,V>`
Overrides:
  `removeAllAsync` in class `GridDistributedCacheAdapter<K,V>`
Returns:
  Remove future.

#### removeAllConflict

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

Removes DR data.

Specified by:
  `removeAllConflict` in interface `IgniteInternalCache<K,V>`
Overrides:
  `removeAllConflict` in class `GridCacheAdapter<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 `IgniteInternalCache<K,V>`
Overrides:
  `removeAllConflictAsync` in class `GridCacheAdapter<K,V>`
Parameters:
  `drMap` - DR map.
Returns:
  Future.
Throws:
  `IgniteCheckedException` - If remove failed.

#### lockAllAsync

    protected IgniteInternalFuture<Boolean> lockAllAsync(Collection<KeyCacheObject> keys,
                                                         long timeout,
                                                         @Nullable
                                                         IgniteTxLocalEx tx,
                                                         boolean isInvalidate,
                                                         boolean isRead,
                                                         boolean retval,
                                                         @Nullable
                                                         TransactionIsolation isolation,
                                                         long createTtl,
                                                         long accessTtl)

Specified by:
  `lockAllAsync` in class `GridDistributedCacheAdapter<K,V>`
Parameters:
  `keys` - Keys to lock.
  `timeout` - Timeout.
  `tx` - Transaction
  `isInvalidate` - Invalidation flag.
  `isRead` - Indicates whether value is read or written.
  `retval` - Flag to return value.
  `isolation` - Transaction isolation.
  `createTtl` - TTL for create operation.
  `accessTtl` - TTL for read operation.
Returns:
  Future for locks.

#### unlockAll

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

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

## Transactions

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

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

#### onDeferredDelete

    public void onDeferredDelete(GridCacheEntryEx entry,
                                 GridCacheVersion ver)

Specified by:
  `onDeferredDelete` in class `GridCacheAdapter<K,V>`
Parameters:
  `entry` - Entry.
  `ver` - Version.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018