org.apache.ignite.internal.processors.cache

## Class GridCacheContext<K,V>

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

All Implemented Interfaces:
  Externalizable, Serializable

    @GridToStringExclude
    public class GridCacheContext<K,V>
    extends Object
    implements Externalizable

Cache context.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridCacheContext()` Empty constructor required for `Externalizable`.

`GridCacheContext(GridKernalContext ctx, GridCacheSharedContext sharedCtx, CacheConfiguration cacheCfg, CacheType cacheType, boolean affNode, boolean updatesAllowed, MemoryPolicy memPlc, FreeList freeList, ReuseList reuseList, GridCacheEventManager evtMgr, CacheStoreManager storeMgr, CacheEvictionManager evictMgr, GridCacheQueryManager<K,V> qryMgr, CacheContinuousQueryManager contQryMgr, CacheDataStructuresManager dataStructuresMgr, GridCacheTtlManager ttlMgr, GridCacheDrManager drMgr, IgniteCacheOffheapManager offheapMgr, CacheConflictResolutionManager<K,V> rslvrMgr, CachePluginManager pluginMgr, GridCacheAffinityManager affMgr)`

### Method Summary

Methods
`<K1,V1> void` `addResult(Map<K1,V1> map, KeyCacheObject key, CacheObject val, boolean skipVals, boolean keepCacheObjects, boolean deserializeBinary, boolean cpy, EntryGetResult getRes, GridCacheVersion ver, long expireTime, long ttl, boolean needVer)`
`<K1,V1> void` `addResult(Map<K1,V1> map, KeyCacheObject key, CacheObject val, boolean skipVals, boolean keepCacheObjects, boolean deserializeBinary, boolean cpy, GridCacheVersion ver, long expireTime, long ttl)`
`<K1,V1> void` `addResult(Map<K1,V1> map, KeyCacheObject key, EntryGetResult getRes, boolean skipVals, boolean keepCacheObjects, boolean deserializeBinary, boolean cpy, boolean needVer)`
`GridCacheAffinityManager` `affinity()`
`boolean` `affinityNode()`
`boolean` `allowFastEviction()`
`boolean` `allowFastLocalRead(int part, List<ClusterNode> affNodes, AffinityTopologyVersion topVer)`
`boolean` `atomic()`
`void` `awaitStarted()`
`boolean` `binaryMarshaller()`
`GridCacheAdapter<K,V>` `cache()`
`void` `cache(GridCacheAdapter<K,V> cache)`
`int` `cacheId()`
`Collection<KeyCacheObject>` `cacheKeysView(Collection<?> keys)`
`CacheObjectContext` `cacheObjectContext()`
`void` `cacheObjectContext(CacheObjectContext cacheObjCtx)` Sets cache object context.
`IgniteCacheObjectProcessor` `cacheObjects()`
`boolean` `cancelRemove(IgniteBiTuple<Boolean,?> interceptorRes)`
`void` `checkSecurity(SecurityPermission op)`
`void` `cleanup()` Nulling references to potentially leak-prone objects.
`GridClosureProcessor` `closures()`
`GridDhtColocatedCache<K,V>` `colocated()`
`CacheConfiguration` `config()`
`boolean` `conflictNeedResolve()` Check whether conflict resolution is required.
`GridCacheVersionConflictContext<K,V>` `conflictResolve(GridCacheVersionedEntryEx<K,V> oldEntry, GridCacheVersionedEntryEx<K,V> newEntry, boolean atomicVerComp)` Resolve DR conflict.
`CacheContinuousQueryManager` `continuousQueries()`
`boolean` `customAffinityMapper()`
`byte` `dataCenterId()`
`CacheDataStructuresManager` `dataStructures()`
`void` `decrementPublicSize(GridCacheMapEntry e)`
`AffinityKeyMapper` `defaultAffMapper()`
`boolean` `deferredDelete()`
`GridCacheDeploymentManager<K,V>` `deploy()`
`boolean` `deploymentEnabled()`
`GridDhtCacheAdapter<K,V>` `dht()`
`void` `dhtMap(GridDhtCacheEntry entry, GridCacheVersion explicitLockVer, IgniteLogger log, Map<ClusterNode,List<GridDhtCacheEntry>> dhtMap, Map<ClusterNode,List<GridDhtCacheEntry>> nearMap)`
`void` `dhtMap(UUID nearNodeId, AffinityTopologyVersion topVer, GridDhtCacheEntry entry, GridCacheVersion explicitLockVer, IgniteLogger log, Map<ClusterNode,List<GridDhtCacheEntry>> dhtMap, Map<ClusterNode,List<GridDhtCacheEntry>> nearMap)`
`GridDhtTransactionalCacheAdapter<K,V>` `dhtTx()`
`GridDiscoveryManager` `discovery()`
`GridCacheDrManager` `dr()`
`IgniteUuid` `dynamicDeploymentId()`
`GridCacheVersion[]` `emptyVersion()`
`CacheEntryPredicate` `equalsVal(V val)`
`GridCacheEventManager` `events()`
`CacheEvictionManager` `evicts()`
`javax.cache.expiry.ExpiryPolicy` `expiry()`
`javax.cache.expiry.ExpiryPolicy` `expiryForTxEntry(IgniteTxEntry txEntry)`
`FreeList` `freeList()`
`GridCacheGateway<K,V>` `gate()`
`IgniteEx` `grid()`
`IgniteConfiguration` `gridConfig()`
`GridDeploymentManager` `gridDeploy()`
`GridEventStorageManager` `gridEvents()`
`GridIoManager` `gridIO()`
`CacheEntryPredicate` `hasVal()`
`String` `igniteInstanceName()`
`void` `incrementPublicSize(GridCacheMapEntry e)`
`GridCacheIoManager` `io()`
`byte` `ioPolicy()`
`<E> boolean` `isAll(E e, IgnitePredicate<? super E>[] p)` Same as `GridFunc.isAll(Object, IgnitePredicate[])`, but safely unwraps exceptions.
`boolean` `isAll(GridCacheEntryEx e, CacheEntryPredicate[] p)`
`<K1,V1> boolean` `isAll(GridCacheEntryEx e, IgnitePredicate<javax.cache.Cache.Entry<K1,V1>>[] p)` Same as `GridFunc.isAll(Object, IgnitePredicate[])`, but safely unwraps exceptions.
`boolean` `isAllLocked(GridCacheEntryEx e, CacheEntryPredicate[] p)`
`boolean` `isColocated()`
`boolean` `isDht()`
`boolean` `isDhtAtomic()`
`boolean` `isDrEnabled()`
`boolean` `isInvalidate()`
`boolean` `isLocal()`
`boolean` `isLocalNode(ClusterNode n)`
`boolean` `isLocalNode(UUID id)`
`boolean` `isNear()`
`boolean` `isPartitioned()`
`boolean` `isReplicated()`
`CacheWeakQueryIteratorsHolder<Map.Entry<K,V>>` `itHolder()`
`CacheJtaManagerAdapter` `jta()`
`boolean` `keepBinary()`
`GridKernalContext` `kernalContext()`
`boolean` `loadPreviousValue()`
`GridLocalCache<K,V>` `local()`
`ClusterNode` `localNode()`
`UUID` `localNodeId()`
`IgniteLogger` `logger(Class<?> cls)`
`IgniteLogger` `logger(String ctgr)`
`List<GridCacheManager<K,V>>` `managers()`
`Marshaller` `marshaller()`
`MemoryPolicy` `memoryPolicy()`
`GridCacheMvccManager` `mvcc()`
`String` `name()`
`String` `namex()` Gets public name for cache.
`String` `namexx()` Gets public cache name substituting null name by `'default'`.
`GridNearCacheAdapter<K,V>` `near()`
`GridNearTransactionalCache<K,V>` `nearTx()`
`boolean` `needsRecovery()`
`void` `needsRecovery(boolean needsRecovery)`
`boolean` `needValueCopy()`
`ClusterNode` `node(UUID nodeId)`
`UUID` `nodeId()`
`CacheEntryPredicate` `noVal()`
`IgniteCacheOffheapManager` `offheap()`
`boolean` `offheapIndex()`
`void` `onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)`
`void` `onStarted()`
`CacheOperationContext` `operationContextPerCall()` Gets thread local cache operation context.
`void` `operationContextPerCall(CacheOperationContext opCtx)` Sets thread local cache operation context.
`CachePluginManager` `plugin()`
`GridCachePreloader` `preloader()`
`void` `printMemoryStats()` Print memory statistics of all cache managers.
`<T> Callable<T>` `projectSafe(Callable<T> r)` Creates callable that can be executed safely in a different thread inheriting the same thread local projection as for the current thread.
`Runnable` `projectSafe(Runnable r)` Creates Runnable that can be executed safely in a different thread inheriting the same thread local projection as for the current thread.
`boolean` `putIfAbsentFilter(CacheEntryPredicate[] p)`
`GridCacheQueryManager<K,V>` `queries()`
`void` `readExternal(ObjectInput in)`
`protected Object` `readResolve()` Reconstructs object on unmarshalling.
`boolean` `readThrough()`
`boolean` `readThroughConfigured()`
`boolean` `rebalanceEnabled()`
`ReuseList` `reuseList()`
`GridCacheSharedContext<K,V>` `shared()`
`boolean` `skipStore()`
`boolean` `started()`
`AffinityTopologyVersion` `startTopologyVersion()`
`void` `startTopologyVersion(AffinityTopologyVersion startTopVer)`
`CacheStoreManager` `store()`
`UUID` `subjectIdPerCall(UUID subjId)` Gets subject ID per call.
`UUID` `subjectIdPerCall(UUID subjId, CacheOperationContext opCtx)` Gets subject ID per call.
`boolean` `syncCommit()`
`boolean` `syncPrimary()`
`boolean` `syncRollback()`
`boolean` `systemTx()`
`GridTimeoutProcessor` `time()`
`IgniteTxManager` `tm()`
`KeyCacheObject` `toCacheKeyObject(byte[] bytes)`
`KeyCacheObject` `toCacheKeyObject(Object obj)`
`CacheObject` `toCacheObject(Object obj)`
`GridDhtPartitionTopology` `topology()`
`GridDhtTopologyFuture` `topologyVersionFuture()`
`String` `toString()`
`boolean` `transactional()`
`GridCacheTtlManager` `ttl()`
`IgniteTxKey` `txKey(KeyCacheObject key)`
`Collection<Object>` `unwrapBinariesIfNeeded(Collection<Object> col, boolean keepBinary)` Unwraps collection.
`Object` `unwrapBinaryIfNeeded(Object o, boolean keepBinary)` Unwraps object for binary.
`Object` `unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy)` Unwraps object for binary.
`Map` `unwrapInvokeResult(Map<Object,javax.cache.processor.EntryProcessorResult> resMap, boolean keepBinary)`
`<T> T` `unwrapTemporary(Object obj)` Converts temporary offheap object to heap-based.
`boolean` `updatesAllowed()`
`boolean` `userCache()`
`IgnitePredicate<javax.cache.Cache.Entry<K,V>>[]` `vararg(IgnitePredicate<javax.cache.Cache.Entry<K,V>> p)`
`GridCacheVersionManager` `versions()`
`void` `writeExternal(ObjectOutput out)`
`boolean` `writeThrough()`
`boolean` `writeToStoreFromDht()`

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

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

### Constructor Detail

#### GridCacheContext

    public GridCacheContext()

Empty constructor required for `Externalizable`.

#### GridCacheContext

    public GridCacheContext(GridKernalContext ctx,
                    GridCacheSharedContext sharedCtx,
                    CacheConfiguration cacheCfg,
                    CacheType cacheType,
                    boolean affNode,
                    boolean updatesAllowed,
                    MemoryPolicy memPlc,
                    FreeList freeList,
                    ReuseList reuseList,
                    GridCacheEventManager evtMgr,
                    CacheStoreManager storeMgr,
                    CacheEvictionManager evictMgr,
                    GridCacheQueryManager<K,V> qryMgr,
                    CacheContinuousQueryManager contQryMgr,
                    CacheDataStructuresManager dataStructuresMgr,
                    GridCacheTtlManager ttlMgr,
                    GridCacheDrManager drMgr,
                    IgniteCacheOffheapManager offheapMgr,
                    CacheConflictResolutionManager<K,V> rslvrMgr,
                    CachePluginManager pluginMgr,
                    GridCacheAffinityManager affMgr)

Parameters:
  `ctx` - Kernal context.
  `sharedCtx` - Cache shared context.
  `cacheCfg` - Cache configuration.
  `cacheType` - Cache type.
  `memPlc` - MemoryPolicy instance.
  `freeList` - FreeList instance.
  `affNode` - `True` if local node is affinity node.
  `updatesAllowed` - Updates allowed flag.
  `evtMgr` - Cache event manager.
  `storeMgr` - Store manager.
  `evictMgr` - Cache eviction manager.
  `qryMgr` - Cache query manager.
  `contQryMgr` - Continuous query manager.
  `affMgr` - Affinity manager.
  `dataStructuresMgr` - Cache dataStructures manager.
  `ttlMgr` - TTL manager.
  `drMgr` - Data center replication manager.
  `rslvrMgr` - Conflict resolution manager.
  `pluginMgr` - Cache plugin manager.

### Method Detail

#### customAffinityMapper

    public boolean customAffinityMapper()

Returns:
  `True` if custom `AffinityKeyMapper` is configured for cache.

#### dynamicDeploymentId

    public IgniteUuid dynamicDeploymentId()

Returns:
  Dynamic deployment ID.

#### affinityNode

    public boolean affinityNode()

Returns:
  `True` if local node is affinity node.

#### awaitStarted

    public void awaitStarted()
                      throws IgniteCheckedException

Throws:
  `IgniteCheckedException` - If failed to wait.

#### started

    public boolean started()

Returns:
  Started flag.

#### onStarted

    public void onStarted()

#### startTopologyVersion

    public AffinityTopologyVersion startTopologyVersion()

Returns:
  Start topology version.

#### startTopologyVersion

    public void startTopologyVersion(AffinityTopologyVersion startTopVer)

Parameters:
  `startTopVer` - Start topology version.

#### expiry

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

Returns:
  Cache default `ExpiryPolicy`.

#### expiryForTxEntry

    @Nullable
    public javax.cache.expiry.ExpiryPolicy expiryForTxEntry(IgniteTxEntry txEntry)

Parameters:
  `txEntry` - TX entry.
Returns:
  Expiry policy for the given TX entry.

#### managers

    public List<GridCacheManager<K,V>> managers()

Returns:
  Cache managers.

#### shared

    public GridCacheSharedContext<K,V> shared()

Returns:
  Shared cache context.

#### cacheId

    public int cacheId()

Returns:
  Cache ID.

#### systemTx

    public boolean systemTx()

Returns:
  `True` if should use system transactions which are isolated from user transactions.

#### userCache

    public boolean userCache()

Returns:
  `True` if cache created by user.

#### ioPolicy

    public byte ioPolicy()

Returns:
  IO policy for the given cache.

#### cache

    public void cache(GridCacheAdapter<K,V> cache)

Parameters:
  `cache` - Cache.

#### local

    public GridLocalCache<K,V> local()

Returns:
  Local cache.

#### isDht

    public boolean isDht()

Returns:
  `True` if cache is DHT.

#### isDhtAtomic

    public boolean isDhtAtomic()

Returns:
  `True` if cache is DHT atomic.

#### isColocated

    public boolean isColocated()

Returns:
  `True` if cache is colocated (dht with near disabled).

#### isNear

    public boolean isNear()

Returns:
  `True` if cache is near cache.

#### isLocal

    public boolean isLocal()

Returns:
  `True` if cache is local.

#### isReplicated

    public boolean isReplicated()

Returns:
  `True` if cache is replicated cache.

#### isPartitioned

    public boolean isPartitioned()

Returns:
  `True` if cache is partitioned cache.

#### isDrEnabled

    public boolean isDrEnabled()

Returns:
  `True` in case replication is enabled.

#### deferredDelete

    public boolean deferredDelete()

Returns:
  `True` if entries should not be deleted from cache immediately.

#### incrementPublicSize

    public void incrementPublicSize(GridCacheMapEntry e)

Parameters:
  `e` - Entry.

#### decrementPublicSize

    public void decrementPublicSize(GridCacheMapEntry e)

Parameters:
  `e` - Entry.

#### dht

    public GridDhtCacheAdapter<K,V> dht()

Returns:
  DHT cache.

#### dhtTx

    public GridDhtTransactionalCacheAdapter<K,V> dhtTx()

Returns:
  Transactional DHT cache.

#### colocated

    public GridDhtColocatedCache<K,V> colocated()

Returns:
  Colocated cache.

#### near

    public GridNearCacheAdapter<K,V> near()

Returns:
  Near cache.

#### nearTx

    public GridNearTransactionalCache<K,V> nearTx()

Returns:
  Near cache for transactional mode.

#### gate

    public GridCacheGateway<K,V> gate()

Returns:
  Cache gateway.

#### kernalContext

    public GridKernalContext kernalContext()

Returns:
  Kernal context.

#### grid

    public IgniteEx grid()

Returns:
  Grid instance.

#### igniteInstanceName

    public String igniteInstanceName()

Returns:
  Ignite instance name.

#### name

    public String name()

Returns:
  Cache name.

#### memoryPolicy

    public MemoryPolicy memoryPolicy()

Returns:
  Memory policy.

#### freeList

    public FreeList freeList()

Returns:
  Free List.

#### reuseList

    public ReuseList reuseList()

Returns:
  Reuse List.

#### namex

    public String namex()

Gets public name for cache.

Returns:
  Public name of the cache.

#### namexx

    public String namexx()

Gets public cache name substituting null name by `'default'`.

Returns:
  Public cache name substituting null name by `'default'`.

#### txKey

    public IgniteTxKey txKey(KeyCacheObject key)

Parameters:
  `key` - Key to construct tx key for.
Returns:
  Transaction key.

#### checkSecurity

    public void checkSecurity(SecurityPermission op)
                       throws SecurityException

Parameters:
  `op` - Operation to check.
Throws:
  `SecurityException` - If security check failed.

#### preloader

    public GridCachePreloader preloader()

Returns:
  Preloader.

#### nodeId

    public UUID nodeId()

Returns:
  Local node ID.

#### rebalanceEnabled

    public boolean rebalanceEnabled()

Returns:
  `True` if rebalance is enabled.

#### atomic

    public boolean atomic()

Returns:
  `True` if atomic.

#### transactional

    public boolean transactional()

Returns:
  `True` if transactional.

#### localNode

    public ClusterNode localNode()

Returns:
  Local node.

#### localNodeId

    public UUID localNodeId()

Returns:
  Local node ID.

#### isLocalNode

    public boolean isLocalNode(ClusterNode n)

Parameters:
  `n` - Node to check.
Returns:
  `True` if node is local.

#### isLocalNode

    public boolean isLocalNode(UUID id)

Parameters:
  `id` - Node ID to check.
Returns:
  `True` if node ID is local.

#### node

    @Nullable
    public ClusterNode node(UUID nodeId)

Parameters:
  `nodeId` - Node id.
Returns:
  Node.

#### topology

    public GridDhtPartitionTopology topology()

Returns:
  Partition topology.

#### topologyVersionFuture

    public GridDhtTopologyFuture topologyVersionFuture()

Returns:
  Topology version future.

#### marshaller

    public Marshaller marshaller()

Returns:
  Marshaller.

#### logger

    public IgniteLogger logger(String ctgr)

Parameters:
  `ctgr` - Category to log.
Returns:
  Logger.

#### logger

    public IgniteLogger logger(Class<?> cls)

Parameters:
  `cls` - Class to log.
Returns:
  Logger.

#### gridConfig

    public IgniteConfiguration gridConfig()

Returns:
  Grid configuration.

#### gridIO

    public GridIoManager gridIO()

Returns:
  Grid communication manager.

#### time

    public GridTimeoutProcessor time()

Returns:
  Grid timeout processor.

#### gridDeploy

    public GridDeploymentManager gridDeploy()

Returns:
  Grid deployment manager.

#### gridEvents

    public GridEventStorageManager gridEvents()

Returns:
  Grid event storage manager.

#### closures

    public GridClosureProcessor closures()

Returns:
  Closures processor.

#### discovery

    public GridDiscoveryManager discovery()

Returns:
  Grid discovery manager.

#### cache

    public GridCacheAdapter<K,V> cache()

Returns:
  Cache instance.

#### config

    public CacheConfiguration config()

Returns:
  Cache configuration for given cache instance.

#### writeToStoreFromDht

    public boolean writeToStoreFromDht()

Returns:
  `True` If store writes should be performed from dht transactions. This happens if both `writeBehindEnabled` and `writeBehindPreferPrimary` cache configuration properties are set to `true` or the store is local.

#### tm

    public IgniteTxManager tm()

Returns:
  Cache transaction manager.

#### versions

    public GridCacheVersionManager versions()

Returns:
  Lock order manager.

#### mvcc

    public GridCacheMvccManager mvcc()

Returns:
  Lock manager.

#### events

    public GridCacheEventManager events()

Returns:
  Event manager.

#### affinity

    public GridCacheAffinityManager affinity()

Returns:
  Cache affinity manager.

#### queries

    public GridCacheQueryManager<K,V> queries()

Returns:
  Query manager, `null` if disabled.

#### continuousQueries

    public CacheContinuousQueryManager continuousQueries()

Returns:
  Continuous query manager, `null` if disabled.

#### itHolder

    public CacheWeakQueryIteratorsHolder<Map.Entry<K,V>> itHolder()

Returns:
  Iterators Holder.

#### store

    public CacheStoreManager store()

Returns:
  Store manager.

#### deploy

    public GridCacheDeploymentManager<K,V> deploy()

Returns:
  Cache deployment manager.

#### io

    public GridCacheIoManager io()

Returns:
  Cache communication manager.

#### evicts

    public CacheEvictionManager evicts()

Returns:
  Eviction manager.

#### dataStructures

    public CacheDataStructuresManager dataStructures()

Returns:
  Data structures manager.

#### dr

    public GridCacheDrManager dr()

Returns:
  DR manager.

#### offheap

    public IgniteCacheOffheapManager offheap()

Returns:
  Offheap manager.

#### ttl

    public GridCacheTtlManager ttl()

Returns:
  TTL manager.

#### jta

    public CacheJtaManagerAdapter jta()

Returns:
  JTA manager.

#### plugin

    public CachePluginManager plugin()

Returns:
  Cache plugin manager.

#### putIfAbsentFilter

    public boolean putIfAbsentFilter(@Nullable
                            CacheEntryPredicate[] p)

Parameters:
  `p` - Predicate.
Returns:
  `True` if given predicate is filter for `putIfAbsent` operation.

#### noVal

    public CacheEntryPredicate noVal()

Returns:
  No value filter.

#### hasVal

    public CacheEntryPredicate hasVal()

Returns:
  Has value filter.

#### equalsVal

    public CacheEntryPredicate equalsVal(V val)

Parameters:
  `val` - Value to check.
Returns:
  Predicate that checks for value.

#### emptyVersion

    public GridCacheVersion[] emptyVersion()

Returns:
  Empty cache version array.

#### defaultAffMapper

    public AffinityKeyMapper defaultAffMapper()

Returns:
  Default affinity key mapper.

#### cacheObjectContext

    public void cacheObjectContext(CacheObjectContext cacheObjCtx)

Sets cache object context.

Parameters:
  `cacheObjCtx` - Cache object context.

#### vararg

    public IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] vararg(IgnitePredicate<javax.cache.Cache.Entry<K,V>> p)

Parameters:
  `p` - Single predicate.
Returns:
  Array containing single predicate.

#### isAll

    public <K1,V1> boolean isAll(GridCacheEntryEx e,
                        @Nullable
                        IgnitePredicate<javax.cache.Cache.Entry<K1,V1>>[] p)
                  throws IgniteCheckedException

Same as `GridFunc.isAll(Object, IgnitePredicate[])`, but safely unwraps exceptions.

Parameters:
  `e` - Element.
  `p` - Predicates.
Returns:
  `True` if predicates passed.
Throws:
  `IgniteCheckedException` - If failed.

#### isAll

    public <E> boolean isAll(E e,
                    @Nullable
                    IgnitePredicate<? super E>[] p)
                  throws IgniteCheckedException

Same as `GridFunc.isAll(Object, IgnitePredicate[])`, but safely unwraps exceptions.

Type Parameters:
  `E` - Element type.
Parameters:
  `e` - Element.
  `p` - Predicates.
Returns:
  `True` if predicates passed.
Throws:
  `IgniteCheckedException` - If failed.

#### isAll

    public boolean isAll(GridCacheEntryEx e,
                CacheEntryPredicate[] p)
                  throws IgniteCheckedException

Parameters:
  `e` - Entry.
  `p` - Predicates.
Returns:
  `True` if predicates passed.
Throws:
  `IgniteCheckedException` - If failed.

#### isAllLocked

    public boolean isAllLocked(GridCacheEntryEx e,
                      CacheEntryPredicate[] p)
                        throws IgniteCheckedException

Parameters:
  `e` - Entry.
  `p` - Predicates.
Returns:
  `True` if predicates passed.
Throws:
  `IgniteCheckedException` - If failed.

#### operationContextPerCall

    public void operationContextPerCall(@Nullable
                               CacheOperationContext opCtx)

Sets thread local cache operation context.

Parameters:
  `opCtx` - Operation context.

#### operationContextPerCall

    public CacheOperationContext operationContextPerCall()

Gets thread local cache operation context.

Returns:
  Operation context per call.

#### subjectIdPerCall

    public UUID subjectIdPerCall(@Nullable
                        UUID subjId)

Gets subject ID per call.

Parameters:
  `subjId` - Optional already existing subject ID.
Returns:
  Subject ID per call.

#### subjectIdPerCall

    public UUID subjectIdPerCall(@Nullable
                        UUID subjId,
                        @Nullable
                        CacheOperationContext opCtx)

Gets subject ID per call.

Parameters:
  `subjId` - Optional already existing subject ID.
  `opCtx` - Optional thread local operation context.
Returns:
  Subject ID per call.

#### skipStore

    public boolean skipStore()

Returns:
  `true` if the skip store flag is set.

#### projectSafe

    public Runnable projectSafe(Runnable r)

Creates Runnable that can be executed safely in a different thread inheriting the same thread local projection as for the current thread. If no projection is set for current thread then there's no need to create new object and method simply returns given Runnable.

Parameters:
  `r` - Runnable.
Returns:
  Runnable that can be executed in a different thread with the same projection as for current thread.

#### projectSafe

    public <T> Callable<T> projectSafe(Callable<T> r)

Creates callable that can be executed safely in a different thread inheriting the same thread local projection as for the current thread. If no projection is set for current thread then there's no need to create new object and method simply returns given callable.

Parameters:
  `r` - Callable.
Returns:
  Callable that can be executed in a different thread with the same projection as for current thread.

#### deploymentEnabled

    public boolean deploymentEnabled()

Returns:
  `True` if deployment is enabled.

#### offheapIndex

    public boolean offheapIndex()

Returns:
  `True` if should use offheap (PageMemory) index.

#### readThrough

    public boolean readThrough()

Returns:
  `True` if store read-through mode is enabled.

#### readThroughConfigured

    public boolean readThroughConfigured()

Returns:
  `True` if store and read-through mode are enabled in configuration.

#### loadPreviousValue

    public boolean loadPreviousValue()

Returns:
  `True` if `CacheConfiguration.isLoadPreviousValue()` flag is set.

#### writeThrough

    public boolean writeThrough()

Returns:
  `True` if store write-through is enabled.

#### isInvalidate

    public boolean isInvalidate()

Returns:
  `True` if invalidation is enabled.

#### syncCommit

    public boolean syncCommit()

Returns:
  `True` if synchronous commit is enabled.

#### syncRollback

    public boolean syncRollback()

Returns:
  `True` if synchronous rollback is enabled.

#### syncPrimary

    public boolean syncPrimary()

Returns:
  `True` if only primary node should be updated synchronously.

#### dhtMap

    public void dhtMap(UUID nearNodeId,
              AffinityTopologyVersion topVer,
              GridDhtCacheEntry entry,
              GridCacheVersion explicitLockVer,
              IgniteLogger log,
              Map<ClusterNode,List<GridDhtCacheEntry>> dhtMap,
              @Nullable
              Map<ClusterNode,List<GridDhtCacheEntry>> nearMap)
                throws GridCacheEntryRemovedException

Parameters:
  `nearNodeId` - Near node ID.
  `topVer` - Topology version.
  `entry` - Entry.
  `log` - Log.
  `dhtMap` - Dht mappings.
  `nearMap` - Near mappings.
Throws:
  `GridCacheEntryRemovedException` - If reader for entry is removed.

#### dhtMap

    public void dhtMap(GridDhtCacheEntry entry,
              GridCacheVersion explicitLockVer,
              IgniteLogger log,
              Map<ClusterNode,List<GridDhtCacheEntry>> dhtMap,
              Map<ClusterNode,List<GridDhtCacheEntry>> nearMap)
                throws GridCacheEntryRemovedException

Parameters:
  `entry` - Entry.
  `log` - Log.
  `dhtMap` - Dht mappings.
  `nearMap` - Near mappings.
Throws:
  `GridCacheEntryRemovedException` - If reader for entry is removed.

#### conflictNeedResolve

    public boolean conflictNeedResolve()

Check whether conflict resolution is required.

Returns:
  `True` in case DR is required.

#### conflictResolve

    public GridCacheVersionConflictContext<K,V> conflictResolve(GridCacheVersionedEntryEx<K,V> oldEntry,
                                                       GridCacheVersionedEntryEx<K,V> newEntry,
                                                       boolean atomicVerComp)
                                                         throws IgniteCheckedException

Resolve DR conflict.

Parameters:
  `oldEntry` - Old entry.
  `newEntry` - New entry.
  `atomicVerComp` - Whether to use atomic version comparator.
Returns:
  Conflict resolution result.
Throws:
  `IgniteCheckedException` - In case of exception.

#### dataCenterId

    public byte dataCenterId()

Returns:
  Data center ID.

#### onDeferredDelete

    public void onDeferredDelete(GridCacheEntryEx entry,
                        GridCacheVersion ver)

Parameters:
  `entry` - Entry.
  `ver` - Version.

#### cancelRemove

    public boolean cancelRemove(@Nullable
                       IgniteBiTuple<Boolean,?> interceptorRes)

Parameters:
  `interceptorRes` - Result of `CacheInterceptor.onBeforeRemove(javax.cache.Cache.Entry<K, V>)` callback.
Returns:
  `True` if interceptor cancels remove.

#### cacheObjects

    public IgniteCacheObjectProcessor cacheObjects()

Returns:
  Binary processor.

#### binaryMarshaller

    public boolean binaryMarshaller()

Returns:
  `True` if `is configured`.

#### keepBinary

    public boolean keepBinary()

Returns:
  Keep binary flag.

#### needValueCopy

    public boolean needValueCopy()

Returns:
  `True` if the value for the cache object has to be copied because of `CacheConfiguration.isCopyOnRead()`.

#### unwrapTemporary

    @Nullable
    public <T> T unwrapTemporary(@Nullable
                                 Object obj)

Converts temporary offheap object to heap-based.

Parameters:
  `obj` - Object.
Returns:
  Heap-based object.

#### unwrapBinariesIfNeeded

    public Collection<Object> unwrapBinariesIfNeeded(Collection<Object> col,
                                            boolean keepBinary)

Unwraps collection.

Parameters:
  `col` - Collection to unwrap.
  `keepBinary` - Keep binary flag.
Returns:
  Unwrapped collection.

#### unwrapBinaryIfNeeded

    public Object unwrapBinaryIfNeeded(Object o,
                              boolean keepBinary)

Unwraps object for binary.

Parameters:
  `o` - Object to unwrap.
  `keepBinary` - Keep binary flag.
Returns:
  Unwrapped object.

#### unwrapBinaryIfNeeded

    public Object unwrapBinaryIfNeeded(Object o,
                              boolean keepBinary,
                              boolean cpy)

Unwraps object for binary.

Parameters:
  `o` - Object to unwrap.
  `keepBinary` - Keep binary flag.
  `cpy` - Copy value flag.
Returns:
  Unwrapped object.

#### unwrapInvokeResult

    public Map unwrapInvokeResult(@Nullable
                         Map<Object,javax.cache.processor.EntryProcessorResult> resMap,
                         boolean keepBinary)

Parameters:
  `resMap` - Invoke results map.
  `keepBinary` - Keep binary flag.
Returns:
  Unwrapped results.

#### cacheObjectContext

    public CacheObjectContext cacheObjectContext()

Returns:
  Cache object context.

#### toCacheObject

    @Nullable
    public CacheObject toCacheObject(@Nullable
                                     Object obj)

Parameters:
  `obj` - Object.
Returns:
  Cache object.

#### toCacheKeyObject

    public KeyCacheObject toCacheKeyObject(Object obj)

Parameters:
  `obj` - Object.
Returns:
  Cache key object.

#### toCacheKeyObject

    public KeyCacheObject toCacheKeyObject(byte[] bytes)
                                    throws IgniteCheckedException

Parameters:
  `bytes` - Bytes.
Returns:
  Cache key object.
Throws:
  `IgniteCheckedException` - If failed.

#### addResult

    public <K1,V1> void addResult(Map<K1,V1> map,
                         KeyCacheObject key,
                         CacheObject val,
                         boolean skipVals,
                         boolean keepCacheObjects,
                         boolean deserializeBinary,
                         boolean cpy,
                         GridCacheVersion ver,
                         long expireTime,
                         long ttl)

Parameters:
  `map` - Map.
  `key` - Key.
  `val` - Value.
  `skipVals` - Skip values flag.
  `keepCacheObjects` - Keep cache objects flag.
  `deserializeBinary` - Deserialize binary flag.
  `cpy` - Copy flag.
  `ver` - GridCacheVersion.

#### addResult

    public <K1,V1> void addResult(Map<K1,V1> map,
                         KeyCacheObject key,
                         EntryGetResult getRes,
                         boolean skipVals,
                         boolean keepCacheObjects,
                         boolean deserializeBinary,
                         boolean cpy,
                         boolean needVer)

Parameters:
  `map` - Map.
  `key` - Key.
  `getRes` - EntryGetResult.
  `skipVals` - Skip values.
  `keepCacheObjects` - Keep CacheObject.
  `deserializeBinary` - Deserialize binary flag.
  `cpy` - Copy flag.
  `needVer` - Need version flag.

#### addResult

    public <K1,V1> void addResult(Map<K1,V1> map,
                         KeyCacheObject key,
                         CacheObject val,
                         boolean skipVals,
                         boolean keepCacheObjects,
                         boolean deserializeBinary,
                         boolean cpy,
                         @Nullable
                         EntryGetResult getRes,
                         GridCacheVersion ver,
                         long expireTime,
                         long ttl,
                         boolean needVer)

Parameters:
  `map` - Map.
  `key` - Key.
  `val` - Value.
  `skipVals` - Skip values.
  `keepCacheObjects` - Keep CacheObject.
  `deserializeBinary` - Deserialize binary.
  `cpy` - Copy flag.
  `getRes` - EntryGetResult.
  `ver` - Version.
  `expireTime` - Entry expire time.
  `ttl` - Entry TTL.
  `needVer` - Need version flag.

#### updatesAllowed

    public boolean updatesAllowed()

Returns:
  Updates allowed.

#### needsRecovery

    public boolean needsRecovery()

Returns:
  Current cache state. Must only be modified during exchange.

#### needsRecovery

    public void needsRecovery(boolean needsRecovery)

Parameters:
  `needsRecovery` - Needs recovery flag.

#### cleanup

    public void cleanup()

Nulling references to potentially leak-prone objects.

#### printMemoryStats

    public void printMemoryStats()

Print memory statistics of all cache managers. NOTE: this method is for testing and profiling purposes only.

#### cacheKeysView

    public Collection<KeyCacheObject> cacheKeysView(Collection<?> keys)

Parameters:
  `keys` - Keys.
Returns:
  Read-only collection of KeyCacheObject instances.

#### allowFastLocalRead

    public boolean allowFastLocalRead(int part,
                             List<ClusterNode> affNodes,
                             AffinityTopologyVersion topVer)

Parameters:
  `part` - Partition.
  `affNodes` - Affinity nodes.
  `topVer` - Topology version.
Returns:
  `True` if cache 'get' operation is allowed to get entry locally.

#### allowFastEviction

    public boolean allowFastEviction()

Returns:
  `True` if fast eviction is allowed.

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

#### readResolve

    protected Object readResolve()
                          throws ObjectStreamException

Reconstructs object on unmarshalling.

Returns:
  Reconstructed object.
Throws:
  `ObjectStreamException` - Thrown in case of unmarshalling error.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.0.0
Release Date | : April 30 2017