@GridToStringExclude public class GridCacheContext<K,V> extends Object implements Externalizable
| Constructor and Description |
|---|
GridCacheContext()
Empty constructor required for
Externalizable. |
GridCacheContext(GridKernalContext ctx,
GridCacheSharedContext sharedCtx,
CacheConfiguration cacheCfg,
CacheGroupContext grp,
CacheType cacheType,
AffinityTopologyVersion locStartTopVer,
boolean affNode,
boolean updatesAllowed,
GridCacheEventManager evtMgr,
CacheStoreManager storeMgr,
CacheEvictionManager evictMgr,
GridCacheQueryManager<K,V> qryMgr,
CacheContinuousQueryManager contQryMgr,
CacheDataStructuresManager dataStructuresMgr,
GridCacheTtlManager ttlMgr,
GridCacheDrManager drMgr,
CacheConflictResolutionManager<K,V> rslvrMgr,
CachePluginManager pluginMgr,
GridCacheAffinityManager affMgr) |
public GridCacheContext()
Externalizable.public GridCacheContext(GridKernalContext ctx, GridCacheSharedContext sharedCtx, CacheConfiguration cacheCfg, CacheGroupContext grp, CacheType cacheType, AffinityTopologyVersion locStartTopVer, boolean affNode, boolean updatesAllowed, GridCacheEventManager evtMgr, CacheStoreManager storeMgr, CacheEvictionManager evictMgr, GridCacheQueryManager<K,V> qryMgr, CacheContinuousQueryManager contQryMgr, CacheDataStructuresManager dataStructuresMgr, GridCacheTtlManager ttlMgr, GridCacheDrManager drMgr, CacheConflictResolutionManager<K,V> rslvrMgr, CachePluginManager pluginMgr, GridCacheAffinityManager affMgr)
ctx - Kernal context.sharedCtx - Cache shared context.cacheCfg - Cache configuration.grp - Cache group.cacheType - Cache type.locStartTopVer - Topology version when cache was started on local node.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.public int groupId()
public CacheGroupContext group()
public boolean customAffinityMapper()
True if custom AffinityKeyMapper is configured for cache.public IgniteUuid dynamicDeploymentId()
public boolean affinityNode()
True if local node is affinity node.public boolean isReplicatedAffinityNode()
true If this is a replicated cache and we are on a data node.public void awaitStarted()
throws IgniteCheckedException
IgniteCheckedException - If failed to wait.public boolean started()
public void onStarted()
public AffinityTopologyVersion startTopologyVersion()
@Nullable public javax.cache.expiry.ExpiryPolicy expiry()
ExpiryPolicy.@Nullable public javax.cache.expiry.ExpiryPolicy expiryForTxEntry(IgniteTxEntry txEntry)
txEntry - TX entry.public List<GridCacheManager<K,V>> managers()
public GridCacheSharedContext<K,V> shared()
public int cacheId()
public Integer cacheIdBoxed()
public boolean systemTx()
True if should use system transactions which are isolated from user transactions.public boolean userCache()
True if cache created by user.public boolean dataStructuresCache()
True if cache created to store data structures.public byte ioPolicy()
public void cache(GridCacheAdapter<K,V> cache)
cache - Cache.public GridLocalCache<K,V> local()
public boolean isDht()
True if cache is DHT.public boolean isDhtAtomic()
True if cache is DHT atomic.public boolean isColocated()
True if cache is colocated (dht with near disabled).public boolean isNear()
True if cache is near cache.public boolean isLocal()
True if cache is local.public boolean isReplicated()
True if cache is replicated cache.public boolean isPartitioned()
True if cache is partitioned cache.public boolean isDrEnabled()
True in case replication is enabled.public boolean isQueryEnabled()
True in case cache supports query.public boolean deferredDelete()
True if entries should not be deleted from cache immediately.public void incrementPublicSize(GridCacheMapEntry e)
e - Entry.public void decrementPublicSize(GridCacheMapEntry e)
e - Entry.public GridDhtCacheAdapter<K,V> dht()
public GridDhtTransactionalCacheAdapter<K,V> dhtTx()
public GridDhtColocatedCache<K,V> colocated()
public GridNearCacheAdapter<K,V> near()
public GridNearTransactionalCache<K,V> nearTx()
public GridCacheGateway<K,V> gate()
public GridKernalContext kernalContext()
public IgniteEx grid()
public String igniteInstanceName()
public String name()
public DataRegion dataRegion()
public IgniteTxKey txKey(KeyCacheObject key)
key - Key to construct tx key for.public void checkSecurity(SecurityPermission op) throws SecurityException
op - Operation to check.SecurityException - If security check failed.public GridCachePreloader preloader()
public UUID nodeId()
public boolean rebalanceEnabled()
True if rebalance is enabled.public boolean atomic()
True if atomic.public boolean transactional()
True if transactional.public boolean transactionalSnapshot()
True if transactional snapshot.public ClusterNode localNode()
public UUID localNodeId()
public boolean isLocalNode(ClusterNode n)
n - Node to check.True if node is local.public boolean isLocalNode(UUID id)
id - Node ID to check.True if node ID is local.@Nullable public ClusterNode node(UUID nodeId)
nodeId - Node id.public GridDhtPartitionTopology topology()
public GridDhtCacheAdapter dhtCache()
public GridDhtTopologyFuture topologyVersionFuture()
public Marshaller marshaller()
public IgniteLogger logger(String ctgr)
ctgr - Category to log.public IgniteLogger logger(Class<?> cls)
cls - Class to log.public IgniteConfiguration gridConfig()
public GridIoManager gridIO()
public GridTimeoutProcessor time()
public GridDeploymentManager gridDeploy()
public GridEventStorageManager gridEvents()
public GridClosureProcessor closures()
public GridDiscoveryManager discovery()
public GridCacheAdapter<K,V> cache()
public CacheConfiguration config()
public boolean writeToStoreFromDht()
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.public IgniteTxManager tm()
public GridCacheVersionManager versions()
public GridCacheMvccManager mvcc()
public GridCacheEventManager events()
public GridCacheAffinityManager affinity()
public GridCacheQueryManager<K,V> queries()
null if disabled.public CacheContinuousQueryManager continuousQueries()
null if disabled.public CacheWeakQueryIteratorsHolder<Map.Entry<K,V>> itHolder()
public CacheStoreManager store()
public GridCacheDeploymentManager<K,V> deploy()
public GridCacheIoManager io()
public CacheEvictionManager evicts()
public CacheDataStructuresManager dataStructures()
public GridCacheDrManager dr()
public IgniteCacheOffheapManager offheap()
public GridCacheTtlManager ttl()
public CacheJtaManagerAdapter jta()
public CachePluginManager plugin()
public boolean putIfAbsentFilter(@Nullable
CacheEntryPredicate[] p)
p - Predicate.True if given predicate is filter for putIfAbsent operation.public CacheEntryPredicate noVal()
public CacheEntryPredicate hasVal()
public CacheEntryPredicate equalsVal(V val)
val - Value to check.public GridCacheVersion[] emptyVersion()
public AffinityKeyMapper defaultAffMapper()
public void cacheObjectContext(CacheObjectContext cacheObjCtx)
cacheObjCtx - Cache object context.public IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] vararg(IgnitePredicate<javax.cache.Cache.Entry<K,V>> p)
p - Single predicate.public <K1,V1> boolean isAll(GridCacheEntryEx e, @Nullable IgnitePredicate<javax.cache.Cache.Entry<K1,V1>>[] p) throws IgniteCheckedException
GridFunc.isAll(Object, IgnitePredicate[]), but safely unwraps exceptions.e - Element.p - Predicates.True if predicates passed.IgniteCheckedException - If failed.public <E> boolean isAll(E e,
@Nullable
IgnitePredicate<? super E>[] p)
throws IgniteCheckedException
GridFunc.isAll(Object, IgnitePredicate[]), but safely unwraps exceptions.E - Element type.e - Element.p - Predicates.True if predicates passed.IgniteCheckedException - If failed.public boolean isAll(GridCacheEntryEx e, CacheEntryPredicate[] p) throws IgniteCheckedException
e - Entry.p - Predicates.True if predicates passed.IgniteCheckedException - If failed.public boolean isAllLocked(GridCacheEntryEx e, CacheEntryPredicate[] p) throws IgniteCheckedException
e - Entry.p - Predicates.True if predicates passed.IgniteCheckedException - If failed.public void operationContextPerCall(@Nullable
CacheOperationContext opCtx)
opCtx - Operation context.public CacheOperationContext operationContextPerCall()
public UUID subjectIdPerCall(@Nullable UUID subjId)
subjId - Optional already existing subject ID.public UUID subjectIdPerCall(@Nullable UUID subjId, @Nullable CacheOperationContext opCtx)
subjId - Optional already existing subject ID.opCtx - Optional thread local operation context.public boolean skipStore()
true if the skip store flag is set.public Runnable projectSafe(Runnable r)
r - Runnable.public <T> Callable<T> projectSafe(Callable<T> r)
r - Callable.public boolean deploymentEnabled()
True if deployment is enabled.public boolean readThrough()
True if store read-through mode is enabled.public boolean readThroughConfigured()
True if store and read-through mode are enabled in configuration.public boolean loadPreviousValue()
True if CacheConfiguration.isLoadPreviousValue() flag is set.public boolean writeThrough()
True if store write-through is enabled.public boolean isInvalidate()
True if invalidation is enabled.public boolean syncCommit()
True if synchronous commit is enabled.public boolean syncRollback()
True if synchronous rollback is enabled.public boolean syncPrimary()
True if only primary node should be updated synchronously.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
nearNodeId - Near node ID.topVer - Topology version.entry - Entry.log - Log.dhtMap - Dht mappings.nearMap - Near mappings.GridCacheEntryRemovedException - If reader for entry is removed.public void dhtMap(GridDhtCacheEntry entry, GridCacheVersion explicitLockVer, IgniteLogger log, Map<ClusterNode,List<GridDhtCacheEntry>> dhtMap, Map<ClusterNode,List<GridDhtCacheEntry>> nearMap) throws GridCacheEntryRemovedException
entry - Entry.log - Log.dhtMap - Dht mappings.nearMap - Near mappings.GridCacheEntryRemovedException - If reader for entry is removed.public boolean conflictNeedResolve()
True in case DR is required.public GridCacheVersionConflictContext<K,V> conflictResolve(GridCacheVersionedEntryEx<K,V> oldEntry, GridCacheVersionedEntryEx<K,V> newEntry, boolean atomicVerComp) throws IgniteCheckedException
oldEntry - Old entry.newEntry - New entry.atomicVerComp - Whether to use atomic version comparator.IgniteCheckedException - In case of exception.public byte dataCenterId()
public void onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)
entry - Entry.ver - Version.public boolean cancelRemove(@Nullable
IgniteBiTuple<Boolean,?> interceptorRes)
interceptorRes - Result of CacheInterceptor.onBeforeRemove(javax.cache.Cache.Entry<K, V>) callback.True if interceptor cancels remove.public IgniteCacheObjectProcessor cacheObjects()
public boolean binaryMarshaller()
True if is configured.public boolean keepBinary()
public boolean needValueCopy()
True if the value for the cache object has to be copied because
of CacheConfiguration.isCopyOnRead().@Nullable
public <T> T unwrapTemporary(@Nullable
Object obj)
obj - Object.public Collection<Object> unwrapBinariesIfNeeded(Collection<Object> col, boolean keepBinary)
col - Collection to unwrap.keepBinary - Keep binary flag.public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary)
o - Object to unwrap.keepBinary - Keep binary flag.public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy)
o - Object to unwrap.keepBinary - Keep binary flag.cpy - Copy value flag.public Map unwrapInvokeResult(@Nullable Map<Object,javax.cache.processor.EntryProcessorResult> resMap, boolean keepBinary)
resMap - Invoke results map.keepBinary - Keep binary flag.public CacheObjectContext cacheObjectContext()
@Nullable public CacheObject toCacheObject(@Nullable Object obj)
obj - Object.public KeyCacheObject toCacheKeyObject(Object obj)
obj - Object.public KeyCacheObject toCacheKeyObject(byte[] bytes) throws IgniteCheckedException
bytes - Bytes.IgniteCheckedException - If failed.public void validateKeyAndValue(KeyCacheObject key, CacheObject val) throws IgniteCheckedException
key - Key.val - Value.IgniteCheckedException, - If validation fails.IgniteCheckedExceptionpublic <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)
map - Map.key - Key.val - Value.skipVals - Skip values flag.keepCacheObjects - Keep cache objects flag.deserializeBinary - Deserialize binary flag.cpy - Copy flag.ver - GridCacheVersion.public <K1,V1> void addResult(Map<K1,V1> map, KeyCacheObject key, EntryGetResult getRes, boolean skipVals, boolean keepCacheObjects, boolean deserializeBinary, boolean cpy, boolean needVer)
map - Map.key - Key.getRes - EntryGetResult.skipVals - Skip values.keepCacheObjects - Keep CacheObject.deserializeBinary - Deserialize binary flag.cpy - Copy flag.needVer - Need version flag.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)
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.public boolean updatesAllowed()
public void cleanup()
public void printMemoryStats()
public Collection<KeyCacheObject> cacheKeysView(Collection<?> keys)
keys - Keys.public boolean reserveForFastLocalGet(int part,
AffinityTopologyVersion topVer)
true, then releaseForFastLocalGet(int, AffinityTopologyVersion) method
must be called after the read is completed.part - Partition.topVer - Topology version.True if cache 'get' operation is allowed to get entry locally.public void releaseForFastLocalGet(int part,
AffinityTopologyVersion topVer)
reserveForFastLocalGet(int, AffinityTopologyVersion).part - Partition to release.topVer - Topology version.public boolean readNoEntry(@Nullable
IgniteCacheExpiryPolicy expiryPlc,
boolean readers)
expiryPlc - Optional expiry policy for read operation.readers - True if need update near cache readers.True if it is possible to directly read offheap instead of using GridCacheEntryEx.innerGet(org.apache.ignite.internal.processors.cache.version.GridCacheVersion, org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx, boolean, boolean, boolean, java.util.UUID, java.lang.Object, java.lang.String, org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy, boolean, org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshot).public boolean mvccEnabled()
True if mvcc is enabled for cache.public boolean recordEvent(int type)
type - Event type.True if event should be recorded.@Nullable public ClusterNode selectAffinityNodeBalanced(List<ClusterNode> affNodes, boolean canRemap)
affNodes - All affinity nodes.canRemap - Flag indicating that 'get' should be done on a locked topology version.null if there is no suitable alive node.public void prepareAffinityField(BinaryObjectBuilder buider)
buider - Builder.public boolean statisticsEnabled()
public void statisticsEnabled(boolean statisticsEnabled)
statisticsEnabled - Statistics enabled flag.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionprotected Object readResolve() throws ObjectStreamException
ObjectStreamException - Thrown in case of unmarshalling error.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019