@GridToStringExclude public class GridCacheContext<K,V> extends Object implements Externalizable
| Constructor and Description |
|---|
GridCacheContext()
Empty constructor required for
Externalizable. |
GridCacheContext(GridKernalContext ctx,
GridCacheConfiguration cacheCfg,
GridCacheMvccManager<K,V> mvccMgr,
GridCacheVersionManager<K,V> verMgr,
GridCacheEventManager<K,V> evtMgr,
GridCacheSwapManager<K,V> swapMgr,
GridCacheStoreManager<K,V> storeMgr,
GridCacheDeploymentManager<K,V> depMgr,
GridCacheEvictionManager<K,V> evictMgr,
GridCacheIoManager<K,V> ioMgr,
GridCacheQueryManager<K,V> qryMgr,
GridCacheContinuousQueryManager<K,V> contQryMgr,
GridCacheDgcManager<K,V> dgcMgr,
GridCacheAffinityManager<K,V> affMgr,
GridCacheTxManager<K,V> txMgr,
GridCacheDataStructuresManager<K,V> dataStructuresMgr,
GridCacheTtlManager<K,V> ttlMgr,
GridCacheDrManager<K,V> drMgr,
GridCacheJtaManagerAdapter<K,V> jtaMgr) |
public GridCacheContext()
Externalizable.public GridCacheContext(GridKernalContext ctx, GridCacheConfiguration cacheCfg, GridCacheMvccManager<K,V> mvccMgr, GridCacheVersionManager<K,V> verMgr, GridCacheEventManager<K,V> evtMgr, GridCacheSwapManager<K,V> swapMgr, GridCacheStoreManager<K,V> storeMgr, GridCacheDeploymentManager<K,V> depMgr, GridCacheEvictionManager<K,V> evictMgr, GridCacheIoManager<K,V> ioMgr, GridCacheQueryManager<K,V> qryMgr, GridCacheContinuousQueryManager<K,V> contQryMgr, GridCacheDgcManager<K,V> dgcMgr, GridCacheAffinityManager<K,V> affMgr, GridCacheTxManager<K,V> txMgr, GridCacheDataStructuresManager<K,V> dataStructuresMgr, GridCacheTtlManager<K,V> ttlMgr, GridCacheDrManager<K,V> drMgr, GridCacheJtaManagerAdapter<K,V> jtaMgr)
ctx - Kernal context.cacheCfg - Cache configuration.mvccMgr - Cache locking manager.verMgr - Cache version manager.evtMgr - Cache event manager.swapMgr - Cache swap manager.storeMgr - Store manager.depMgr - Cache deployment manager.evictMgr - Cache eviction manager.ioMgr - Cache communication manager.qryMgr - Cache query manager.contQryMgr - Continuous query manager.dgcMgr - Distributed garbage collector manager.affMgr - Affinity manager.txMgr - Cache transaction manager.dataStructuresMgr - Cache dataStructures manager.ttlMgr - TTL manager.drMgr - Data center replication manager.jtaMgr - JTA manager.public List<GridCacheManager<K,V>> managers()
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 Grid grid()
public String gridName()
public String name()
public String namex()
public String namexx()
'default'.'default'.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 GridNode localNode()
public UUID localNodeId()
public boolean isLocalNode(GridNode 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.public GridDhtPartitionTopology<K,V> topology()
public GridDhtTopologyFuture topologyVersionFuture()
public GridMarshaller marshaller()
public GridLogger logger(String ctgr)
ctgr - Category to log.public GridLogger logger(Class<?> cls)
cls - Class to log.public GridConfiguration 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 GridCacheConfiguration 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 GridCacheTxManager<K,V> tm()
public GridCacheAffinityManager<K,V> affinity()
public GridCacheVersionManager<K,V> versions()
public GridCacheMvccManager<K,V> mvcc()
public GridCacheEventManager<K,V> events()
@Nullable public GridCacheQueryManager<K,V> queries()
@Nullable public GridCacheContinuousQueryManager<K,V> continuousQueries()
public GridCacheSwapManager<K,V> swap()
public GridCacheStoreManager<K,V> store()
public GridCacheDgcManager<K,V> dgc()
public GridCacheDeploymentManager<K,V> deploy()
public GridCacheIoManager<K,V> io()
public GridCacheEvictionManager<K,V> evicts()
public GridCacheDataStructuresManager<K,V> dataStructures()
public GridCacheDrManager<K,V> dr()
public GridCacheTtlManager<K,V> ttl()
public GridCacheJtaManagerAdapter<K,V> jta()
public GridPredicate<GridCacheEntry<K,V>>[] noGetArray()
public GridPredicate<GridCacheEntry<K,V>>[] hasGetArray()
public GridPredicate<GridCacheEntry<K,V>>[] noPeekArray()
public GridPredicate<GridCacheEntry<K,V>>[] hasPeekArray()
public GridPredicate<GridCacheEntry<K,V>>[] equalsPeekArray(V val)
val - Value to check.public GridPredicate<GridCacheEntry<K,V>> truex()
public GridPredicate<GridCacheEntry<K,V>>[] trueArray()
public GridCacheVersion[] emptyVersion()
public GridPredicate<GridCacheEntry<K,V>>[] vararg(GridPredicate<GridCacheEntry<K,V>> p)
p - Single predicate.public <K,V> boolean isAll(GridCacheEntryEx<K,V> e, @Nullable GridPredicate<GridCacheEntry<K,V>>[] p) throws GridException
GridFunc.isAll(Object, GridPredicate[]), but safely unwraps
exceptions.e - Element.p - Predicates.True if predicates passed.GridException - If failed.public <E> boolean isAll(E e,
@Nullable
GridPredicate<? super E>[] p)
throws GridException
GridFunc.isAll(Object, GridPredicate[]), but safely unwraps
exceptions.E - Element type.e - Element.p - Predicates.True if predicates passed.GridException - If failed.@Nullable public GridCacheFlag[] forceLocal()
@Nullable public GridCacheFlag[] forceLocalRead()
@Nullable public GridCacheFlag[] forceFlags(@Nullable GridCacheFlag[] flags)
flags - Flags to force.public GridCacheFlag[] forcedFlags()
public GridCachePeekMode[] excludePeekModes(@Nullable GridCachePeekMode[] modes)
modes - Peek modes to exclude.public GridCachePeekMode[] peekModeExcludes()
public boolean peekModeExcluded(GridCachePeekMode mode)
mode - Peek mode.true if given peek mode is excluded.@Nullable public <T> T cloneValue(@Nullable T obj) throws GridException
obj - Object to cloneGridException - If failed to clone object.public GridCacheProjectionImpl<K,V> projectionPerCall()
public UUID subjectIdPerCall(@Nullable UUID subjId)
subjId - Optional already existing subject ID.public boolean hasFlag(GridCacheFlag flag)
flag - Flag to check.true if the given flag is set.public boolean hasAnyFlags(GridCacheFlag[] flags)
flags - Flags to check.true if any of the given flags is set.public boolean hasAnyFlags(Collection<GridCacheFlag> flags)
flags - Flags to check.true if any of the given flags is set.public void denyOnFlag(GridCacheFlag flag)
flag - Flag to check.public void denyOnLocalRead()
public void denyOnFlags(GridCacheFlag[] flags)
flags - Flags.public void denyOnFlags(Collection<GridCacheFlag> flags)
flags - Flags.@Nullable public <T> T cloneOnFlag(@Nullable T obj) throws GridException
GridCacheFlag.CLONE flag
is set thread locally.obj - Object to clone.GridException - If failed to clone.public GridFuture<V> wrapClone(GridFuture<V> f)
f - Target future.public GridFuture<Map<K,V>> wrapCloneMap(GridFuture<Map<K,V>> f)
f - Target future.public void checkTxFlags(@Nullable Collection<GridCacheFlag> flags) throws GridCacheFlagException
flags - Flags to turn on.GridCacheFlagException - If given flags are conflicting with given transaction.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 isStoreEnabled()
True if store 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, GridLogger log, Map<GridNode,List<GridDhtCacheEntry<K,V>>> dhtMap, Map<GridNode,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 long preloadExchangeTimeout()
4 times
bigger than network timeout by default.public GridFuture<?> partitionReleaseFuture(Collection<Integer> parts, long topVer)
parts - Partitions.topVer - Topology version.true if waiting was successful.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 drNeedResolve(GridCacheVersion oldVer, GridCacheVersion newVer)
oldVer - Old version.newVer - New version.True in case DR is required.public GridDrReceiverConflictContextImpl<K,V> drResolveConflict(K key, GridDrEntry<K,V> oldEntry, GridDrEntry<K,V> newEntry) throws GridException
key - Key.oldEntry - Old entry.newEntry - New entry.GridException - In case of exception.public void onDeferredDelete(GridCacheEntryEx<K,V> entry, GridCacheVersion ver)
entry - Entry.ver - Version.public boolean cancelRemove(@Nullable GridBiTuple<Boolean,?> interceptorRes)
interceptorRes - Result of GridCacheInterceptor.onBeforeRemove(K, V) callback.True if interceptor cancels remove.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 demarshalling error.Copyright © 2014. All rights reserved.