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
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDFLT_READ_LOAD_BALANCING
-
Constructor Summary
Constructors Constructor Description GridCacheContext()Empty constructor required forExternalizable.GridCacheContext(GridKernalContext ctx, GridCacheSharedContext sharedCtx, CacheConfiguration cacheCfg, CacheGroupContext grp, CacheType cacheType, AffinityTopologyVersion locStartTopVer, IgniteUuid deploymentId, boolean affNode, boolean updatesAllowed, boolean statisticsEnabled, boolean recoveryMode, 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, PlatformCacheManager platformMgr)
-
Method Summary
-
-
-
Constructor Detail
-
GridCacheContext
public GridCacheContext()
Empty constructor required forExternalizable.
-
GridCacheContext
public GridCacheContext(GridKernalContext ctx, GridCacheSharedContext sharedCtx, CacheConfiguration cacheCfg, CacheGroupContext grp, CacheType cacheType, AffinityTopologyVersion locStartTopVer, IgniteUuid deploymentId, boolean affNode, boolean updatesAllowed, boolean statisticsEnabled, boolean recoveryMode, 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, PlatformCacheManager platformMgr)
- Parameters:
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-Trueif 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
-
finishRecovery
public void finishRecovery(AffinityTopologyVersion topVer, DynamicCacheDescriptor clusterWideDesc)
Called when cache was restored during recovery and node has joined to topology.- Parameters:
topVer- Cache topology join version.clusterWideDesc- Cluster-wide cache descriptor received during exchange.
-
isRecoveryMode
public boolean isRecoveryMode()
- Returns:
Trueif cache is in recovery mode.
-
groupId
public int groupId()
- Returns:
- Cache group ID.
-
group
public CacheGroupContext group()
- Returns:
- Cache group.
-
dynamicDeploymentId
public IgniteUuid dynamicDeploymentId()
- Returns:
- Dynamic deployment ID.
-
affinityNode
public boolean affinityNode()
- Returns:
Trueif local node is affinity node.
-
isReplicatedAffinityNode
public boolean isReplicatedAffinityNode()
- Returns:
trueIf this is a replicated cache and we are on a data 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:
- Topology version when cache was started on local node.
-
expiry
@Nullable public @Nullable javax.cache.expiry.ExpiryPolicy expiry()
- Returns:
- Cache default
ExpiryPolicy.
-
expiryForTxEntry
@Nullable public @Nullable 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.
-
cacheIdBoxed
public Integer cacheIdBoxed()
- Returns:
- Cache ID.
-
systemTx
public boolean systemTx()
- Returns:
Trueif should use system transactions which are isolated from user transactions.
-
userCache
public boolean userCache()
- Returns:
Trueif cache created by user.
-
dataStructuresCache
public boolean dataStructuresCache()
- Returns:
Trueif cache created to store data structures.
-
ioPolicy
public byte ioPolicy()
- Returns:
- IO policy for the given cache.
-
cache
public void cache(GridCacheAdapter<K,V> cache)
- Parameters:
cache- Cache.
-
isDht
public boolean isDht()
- Returns:
Trueif cache is DHT.
-
isDhtAtomic
public boolean isDhtAtomic()
- Returns:
Trueif cache is DHT atomic.
-
isColocated
public boolean isColocated()
- Returns:
Trueif cache is colocated (dht with near disabled).
-
isNear
public boolean isNear()
- Returns:
Trueif cache is near cache.
-
isReplicated
public boolean isReplicated()
- Returns:
Trueif cache is replicated cache.
-
isPartitioned
public boolean isPartitioned()
- Returns:
Trueif cache is partitioned cache.
-
isDrEnabled
public boolean isDrEnabled()
- Returns:
Truein case replication is enabled.
-
isQueryEnabled
public boolean isQueryEnabled()
- Returns:
Truein case cache supports query.
-
deferredDelete
public boolean deferredDelete()
- Returns:
Trueif 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.
-
dataRegion
public DataRegion dataRegion()
- Returns:
- Data region.
-
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:
Trueif rebalance is enabled.
-
atomic
public boolean atomic()
- Returns:
Trueif atomic.
-
transactional
public boolean transactional()
- Returns:
Trueif transactional.
-
disableTriggeringCacheInterceptorOnConflict
public boolean disableTriggeringCacheInterceptorOnConflict()
- Returns:
Trueif cache interceptor should be skipped in case of conflicts.
-
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:
Trueif node is local.
-
isLocalNode
public boolean isLocalNode(UUID id)
- Parameters:
id- Node ID to check.- Returns:
Trueif node ID is local.
-
node
@Nullable public @Nullable ClusterNode node(UUID nodeId)
- Parameters:
nodeId- Node id.- Returns:
- Node.
-
topology
public GridDhtPartitionTopology topology()
- Returns:
- Partition topology.
-
dhtCache
public GridDhtCacheAdapter dhtCache()
- Returns:
- DHT cache.
-
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.
- Throws:
IllegalStateException- If this cache context was cleaned up.
-
writeToStoreFromDht
public boolean writeToStoreFromDht()
- Returns:
TrueIf store writes should be performed from dht transactions. This happens if bothwriteBehindEnabledandwriteBehindPreferPrimarycache configuration properties are set totrueor 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,
nullif disabled.
-
continuousQueries
public CacheContinuousQueryManager continuousQueries()
- Returns:
- Continuous query manager,
nullif 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 @Nullable CacheEntryPredicate[] p)- Parameters:
p- Predicate.- Returns:
Trueif given predicate is filter forputIfAbsentoperation.
-
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.
-
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 <E> boolean isAll(E e, @Nullable @Nullable IgnitePredicate<? super E>[] p) throws IgniteCheckedExceptionSame asGridFunc.isAll(Object, IgnitePredicate[]), but safely unwraps exceptions.- Type Parameters:
E- Element type.- Parameters:
e- Element.p- Predicates.- Returns:
Trueif predicates passed.- Throws:
IgniteCheckedException- If failed.
-
isAll
public boolean isAll(GridCacheEntryEx e, CacheEntryPredicate[] p) throws IgniteCheckedException
- Parameters:
e- Entry.p- Predicates.- Returns:
Trueif predicates passed.- Throws:
IgniteCheckedException- If failed.
-
isAllLocked
public boolean isAllLocked(GridCacheEntryEx e, CacheEntryPredicate[] p) throws IgniteCheckedException
- Parameters:
e- Entry.p- Predicates.- Returns:
Trueif predicates passed.- Throws:
IgniteCheckedException- If failed.
-
operationContextPerCall
public void operationContextPerCall(@Nullable @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.
-
skipStore
public boolean skipStore()
- Returns:
trueif 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:
Trueif deployment is enabled.
-
readThrough
public boolean readThrough()
- Returns:
Trueif store read-through mode is enabled.
-
readThroughConfigured
public boolean readThroughConfigured()
- Returns:
Trueif store and read-through mode are enabled in configuration.
-
loadPreviousValue
public boolean loadPreviousValue()
- Returns:
TrueifCacheConfiguration.isLoadPreviousValue()flag is set.
-
writeThrough
public boolean writeThrough()
- Returns:
Trueif store write-through is enabled.
-
isInvalidate
public boolean isInvalidate()
- Returns:
Trueif invalidation is enabled.
-
syncCommit
public boolean syncCommit()
- Returns:
Trueif synchronous commit is enabled.
-
syncRollback
public boolean syncRollback()
- Returns:
Trueif synchronous rollback is enabled.
-
syncPrimary
public boolean syncPrimary()
- Returns:
Trueif 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 @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:
Truein case DR is required.
-
conflictResolver
public CacheVersionConflictResolver conflictResolver()
- Returns:
- Conflict resolver.
-
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 @Nullable IgniteBiTuple<Boolean,?> interceptorRes)- Parameters:
interceptorRes- Result ofCacheInterceptor.onBeforeRemove(javax.cache.Cache.Entry<K, V>)callback.- Returns:
Trueif interceptor cancels remove.
-
cacheObjects
public IgniteCacheObjectProcessor cacheObjects()
- Returns:
- Binary processor.
-
binaryMarshaller
public boolean binaryMarshaller()
- Returns:
Trueifis configured.
-
keepBinary
public boolean keepBinary()
- Returns:
- Keep binary flag.
-
needValueCopy
public boolean needValueCopy()
- Returns:
Trueif the value for the cache object has to be copied because ofCacheConfiguration.isCopyOnRead().
-
unwrapTemporary
@Nullable public <T> T unwrapTemporary(@Nullable @Nullable Object obj)Converts temporary offheap object to heap-based.- Parameters:
obj- Object.- Returns:
- Heap-based object.
-
unwrapBinariesIfNeeded
public Collection<Object> unwrapBinariesIfNeeded(Collection<?> 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, @Nullable @Nullable ClassLoader ldr)
Unwraps object for binary.- Parameters:
o- Object to unwrap.keepBinary- Keep binary flag.ldr- Class loader, used for deserialization from binary representation.- Returns:
- Unwrapped object.
-
unwrapBinaryIfNeeded
public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy, @Nullable @Nullable ClassLoader ldr)
Unwraps object for binary.- Parameters:
o- Object to unwrap.keepBinary- Keep binary flag.cpy- Copy value flag.ldr- Class loader, used for deserialization from binary representation.- Returns:
- Unwrapped object.
-
unwrapInvokeResult
public Map unwrapInvokeResult(@Nullable @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 @Nullable CacheObject toCacheObject(@Nullable @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.
-
validateKeyAndValue
public void validateKeyAndValue(KeyCacheObject key, CacheObject val) throws IgniteCheckedException
Performs validation of provided key and value against configured constraints.- Parameters:
key- Key.val- Value.- Throws:
IgniteCheckedException
-
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, @Nullable @Nullable ClassLoader ldr)
- 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.ldr- Class loader, used for deserialization from binary representation.
-
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 @Nullable EntryGetResult getRes, GridCacheVersion ver, long expireTime, long ttl, boolean needVer, @Nullable @Nullable ClassLoader ldr)
- 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.ldr- Class loader, used for deserialization from binary representation.
-
updatesAllowed
public boolean updatesAllowed()
- Returns:
- Updates allowed.
-
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.
-
reserveForFastLocalGet
public boolean reserveForFastLocalGet(int part, AffinityTopologyVersion topVer)Checks if local reads are allowed for the given partition and reserves the partition when needed. If this method returnstrue, thenreleaseForFastLocalGet(int, AffinityTopologyVersion)method must be called after the read is completed.- Parameters:
part- Partition.topVer- Topology version.- Returns:
Trueif cache 'get' operation is allowed to get entry locally.
-
releaseForFastLocalGet
public void releaseForFastLocalGet(int part, AffinityTopologyVersion topVer)Releases the partition that was reserved by a call toreserveForFastLocalGet(int, AffinityTopologyVersion).- Parameters:
part- Partition to release.topVer- Topology version.
-
readNoEntry
public boolean readNoEntry(@Nullable @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean readers)Checks if it is possible to directly read data memory without entry creation (this is optimization to avoid unnecessary blocking synchronization on cache entry).- Parameters:
expiryPlc- Optional expiry policy for read operation.readers-Trueif need update near cache readers.- Returns:
Trueif it is possible to directly read offheap instead of usingGridCacheEntryEx.innerGet(org.apache.ignite.internal.processors.cache.version.GridCacheVersion, org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx, boolean, boolean, boolean, java.lang.Object, java.lang.String, org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy, boolean).
-
recordEvent
public boolean recordEvent(int type)
- Parameters:
type- Event type.- Returns:
Trueif event should be recorded.
-
selectAffinityNodeBalanced
@Nullable public @Nullable ClusterNode selectAffinityNodeBalanced(List<ClusterNode> affNodes, Set<ClusterNode> invalidNodes, int partId, boolean canRemap, boolean forcePrimary)
Determines an affinity node to send get request to.- Parameters:
affNodes- All affinity nodes.canRemap- Flag indicating that 'get' should be done on a locked topology version.partId- Partition ID.forcePrimary- Force primary flag.- Returns:
- Affinity node to get key from or
nullif there is no suitable alive node.
-
prepareAffinityField
public void prepareAffinityField(BinaryObjectBuilder builder)
Prepare affinity field for builder (if possible).- Parameters:
builder- Builder.
-
statisticsEnabled
public boolean statisticsEnabled()
- Returns:
- Statistics enabled flag.
-
statisticsEnabled
public void statisticsEnabled(boolean statisticsEnabled)
- Parameters:
statisticsEnabled- Statistics enabled flag.
-
onSchemaAddQueryEntity
public void onSchemaAddQueryEntity(SchemaAddQueryEntityOperation op)
Apply changes fromSchemaAddQueryEntityOperation.- Parameters:
op- Add query entity schema operation.
-
onSchemaAddQueryEntity
public void onSchemaAddQueryEntity(Collection<QueryEntity> entities, String sqlSchema, boolean isSqlEscape, int qryParallelism)
Apply changes on enable indexing.- Parameters:
entities- New query entities.sqlSchema- Sql schema name.isSqlEscape- Sql escape flag.qryParallelism- Query parallelism parameter.
-
lastRemoveAllJobFut
public AtomicReference<IgniteInternalFuture<Boolean>> lastRemoveAllJobFut()
Returns future that assigned to last performingGridDistributedCacheAdapter.GlobalRemoveAllJob.
-
dumpListener
public DumpEntryChangeListener dumpListener()
-
dumpListener
public void dumpListener(DumpEntryChangeListener dumpEntryChangeLsnr)
-
transactionChanges
public TransactionChanges<Object> transactionChanges(Integer part)
- Parameters:
part- Partition.- Returns:
- First, set of object changed in transaction, second, list of transaction data in required format.
- See Also:
ExecutionContext#transactionChanges(int, int[], Function)
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
readResolve
protected Object readResolve() throws ObjectStreamException
Reconstructs object on unmarshalling.- Returns:
- Reconstructed object.
- Throws:
ObjectStreamException- Thrown in case of unmarshalling error.
-
-