@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,
GridCacheEventManager<K,V> evtMgr,
GridCacheSwapManager<K,V> swapMgr,
IgniteCacheSerializationManager<K,V> serMgr,
GridCacheStoreManager<K,V> storeMgr,
GridCacheEvictionManager<K,V> evictMgr,
GridCacheQueryManager<K,V> qryMgr,
CacheContinuousQueryManager<K,V> contQryMgr,
GridCacheAffinityManager<K,V> affMgr,
CacheDataStructuresManager<K,V> dataStructuresMgr,
GridCacheTtlManager<K,V> ttlMgr,
GridCacheDrManager<K,V> drMgr,
CacheJtaManagerAdapter<K,V> jtaMgr) |
public GridCacheContext()
Externalizable.public GridCacheContext(GridKernalContext ctx, GridCacheSharedContext sharedCtx, CacheConfiguration cacheCfg, GridCacheEventManager<K,V> evtMgr, GridCacheSwapManager<K,V> swapMgr, IgniteCacheSerializationManager<K,V> serMgr, GridCacheStoreManager<K,V> storeMgr, GridCacheEvictionManager<K,V> evictMgr, GridCacheQueryManager<K,V> qryMgr, CacheContinuousQueryManager<K,V> contQryMgr, GridCacheAffinityManager<K,V> affMgr, CacheDataStructuresManager<K,V> dataStructuresMgr, GridCacheTtlManager<K,V> ttlMgr, GridCacheDrManager<K,V> drMgr, CacheJtaManagerAdapter<K,V> jtaMgr)
ctx - Kernal context.sharedCtx - Cache shared context.cacheCfg - Cache configuration.evtMgr - Cache event manager.swapMgr - Cache swap 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.jtaMgr - JTA manager.@Nullable public javax.cache.expiry.ExpiryPolicy expiry()
ExpiryPolicy.public List<GridCacheManager<K,V>> managers()
public GridCacheSharedContext<K,V> shared()
public int cacheId()
public boolean system()
public GridIoPolicy 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 isDrEnabled()
True in case replication is enabled.public boolean deferredDelete()
True if entries should not be deleted from cache immediately.public void incrementPublicSize(GridCacheMapEntry<K,V> e)
e - Entry.public void decrementPublicSize(GridCacheMapEntry<K,V> 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()
@Nullable public GridUnsafeMemory unsafeMemory()
GridUnsafeMemory object.public GridKernalContext kernalContext()
public IgniteEx grid()
public String gridName()
public String name()
public String namex()
public String namexx()
'default'.'default'.public IgniteTxKey<K> txKey(K key)
key - Key to construct tx key for.public void checkSecurity(GridSecurityPermission op) throws GridSecurityException
op - Operation to check.GridSecurityException - If security check failed.public GridCachePreloader<K,V> preloader()
public UUID nodeId()
public boolean preloadEnabled()
True if preload is enabled.public boolean atomic()
True if atomic.public boolean transactional()
True if transactional.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<K,V> topology()
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 GridOffHeapProcessor offheap()
public GridDeploymentManager gridDeploy()
public GridSwapSpaceManager gridSwap()
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<K,V> tm()
public GridCacheVersionManager<K,V> versions()
public GridCacheMvccManager<K,V> mvcc()
public GridCacheEventManager<K,V> events()
public GridCacheAffinityManager<K,V> affinity()
public GridCacheQueryManager<K,V> queries()
null if disabled.public CacheContinuousQueryManager<K,V> continuousQueries()
null if disabled.public CacheWeakQueryIteratorsHolder<Map.Entry<K,V>> itHolder()
public GridCacheSwapManager<K,V> swap()
public GridCacheStoreManager<K,V> store()
public GridCacheDeploymentManager<K,V> deploy()
public GridCacheIoManager<K,V> io()
public GridCacheEvictionManager<K,V> evicts()
public CacheDataStructuresManager<K,V> dataStructures()
public GridCacheDrManager<K,V> dr()
public GridCacheTtlManager<K,V> ttl()
public CacheJtaManagerAdapter<K,V> jta()
public IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] noGetArray()
public IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] hasGetArray()
public IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] noPeekArray()
public IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] hasPeekArray()
public IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] equalsPeekArray(V val)
val - Value to check.public IgnitePredicate<javax.cache.Cache.Entry<K,V>> truex()
public IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] trueArray()
public GridCacheVersion[] emptyVersion()
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<K1,V1> 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.@Nullable public CacheFlag[] forceLocal()
@Nullable public CacheFlag[] forceLocalRead()
@Nullable public CacheFlag[] forceFlags(@Nullable CacheFlag[] flags)
flags - Flags to force.public CacheFlag[] forcedFlags()
@Nullable public <T> T cloneValue(@Nullable T obj) throws IgniteCheckedException
obj - Object to cloneIgniteCheckedException - If failed to clone object.public void projectionPerCall(@Nullable GridCacheProjectionImpl<K,V> prj)
prj - Flags to set.public GridCacheProjectionImpl<K,V> projectionPerCall()
public UUID subjectIdPerCall(@Nullable UUID subjId)
subjId - Optional already existing subject ID.public UUID subjectIdPerCall(@Nullable UUID subjId, @Nullable GridCacheProjectionImpl<K,V> prj)
subjId - Optional already existing subject ID.prj - Optional thread local projection.public boolean hasFlag(CacheFlag flag)
flag - Flag to check.true if the given flag is set.public boolean hasAnyFlags(CacheFlag[] flags)
flags - Flags to check.true if any of the given flags is set.public boolean hasAnyFlags(Collection<CacheFlag> flags)
flags - Flags to check.true if any of the given flags is set.public void denyOnFlag(CacheFlag flag)
flag - Flag to check.public void denyOnLocalRead()
public void denyOnFlags(CacheFlag[] flags)
flags - Flags.public void denyOnFlags(Collection<CacheFlag> flags)
flags - Flags.@Nullable public <T> T cloneOnFlag(@Nullable T obj) throws IgniteCheckedException
CacheFlag.CLONE flag
is set thread locally.obj - Object to clone.IgniteCheckedException - If failed to clone.public IgniteInternalFuture<V> wrapClone(IgniteInternalFuture<V> f)
f - Target future.public IgniteInternalFuture<Map<K,V>> wrapCloneMap(IgniteInternalFuture<Map<K,V>> f)
f - Target future.public Runnable projectSafe(Runnable r)
r - Runnable.public <T> Callable<T> projectSafe(Callable<T> r)
r - Callable.public boolean isUnmarshalValues()
True if values should be always unmarshalled.public boolean deploymentEnabled()
True if deployment enabled.public boolean isSwapOrOffheapEnabled()
True if swap store of off-heap cache are enabled.public boolean isOffHeapEnabled()
True if offheap storage is enabled.public boolean readThrough()
True if store read-through mode is enabled.public boolean loadPreviousValue()
True if store read-through mode is enabled.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 boolean dhtMap(UUID nearNodeId, long topVer, GridDhtCacheEntry<K,V> entry, IgniteLogger log, Map<ClusterNode,List<GridDhtCacheEntry<K,V>>> dhtMap, @Nullable Map<ClusterNode,List<GridDhtCacheEntry<K,V>>> nearMap) throws GridCacheEntryRemovedException
nearNodeId - Near node ID.topVer - Topology version.entry - Entry.log - Log.dhtMap - Dht mappings.nearMap - Near mappings.True if mapped.GridCacheEntryRemovedException - If reader for entry is removed.public boolean hasKey(Iterable<? extends K> keys, Collection<Integer> movingParts)
keys - Collection of keys to check.movingParts - Collection of partitions to check against.True if there exist a key in collection keys that belongs
to one of partitions in movingPartspublic boolean conflictNeedResolve(GridCacheVersion oldVer, GridCacheVersion newVer)
oldVer - Old version.newVer - New version.True in case DR is required.public GridCacheVersionConflictContext<K,V> conflictResolve(GridCacheVersionedEntryEx<K,V> oldEntry, GridCacheVersionedEntryEx<K,V> newEntry, boolean atomicVerComparator) throws IgniteCheckedException
oldEntry - Old entry.newEntry - New entry.atomicVerComparator - Whether to use atomic version comparator.IgniteCheckedException - In case of exception.public byte dataCenterId()
public void onDeferredDelete(GridCacheEntryEx<K,V> entry, GridCacheVersion ver)
entry - Entry.ver - Version.public boolean cancelRemove(@Nullable IgniteBiTuple<Boolean,?> interceptorRes)
interceptorRes - Result of CacheInterceptor.onBeforeRemove(K, V) callback.True if interceptor cancels remove.public GridPortableProcessor portable()
public boolean portableEnabled()
public boolean keepPortableInStore()
public boolean keepPortable()
public boolean offheapTiered()
True if OFFHEAP_TIERED memory mode is enabled.@Nullable public <T> T unwrapTemporary(@Nullable Object obj)
obj - Object.public byte[] convertPortableBytes(byte[] bytes)
throws IgniteCheckedException
bytes - Object marshalled with portable marshaller.IgniteCheckedException - If failed.@Nullable public Object marshalToPortable(@Nullable Object obj) throws IgniteException
obj - Object.IgniteException - In case of error.public Collection<Object> unwrapPortablesIfNeeded(Collection<Object> col, boolean keepPortable)
col - Collection to unwrap.keepPortable - Keep portable flag.public Object unwrapPortableIfNeeded(Object o, boolean keepPortable)
o - Object to unwrap.keepPortable - Keep portable flag.public void cleanup()
public void printMemoryStats()
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 Fabric : ver. 1.0.0-RC1 Release Date : February 17 2015