public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter implements GridCacheEntryEx
GridMetadataAwareAdapter.EntryKey| Modifier and Type | Field and Description |
|---|---|
static GridCacheAtomicVersionComparator |
ATOMIC_VER_COMPARATOR |
protected GridCacheContext<?,?> |
cctx
Cache registry.
|
protected byte |
flags
Flags:
Deleted flag - mask
IS_DELETED_MASK
Unswapped flag - mask IS_UNSWAPPED_MASK
|
protected KeyCacheObject |
key
Key.
|
protected static IgniteLogger |
log
Logger.
|
protected static AtomicReference<IgniteLogger> |
logRef
Static logger to avoid re-creation.
|
protected long |
startVer
Start version.
|
protected CacheObject |
val
Value.
|
protected GridCacheVersion |
ver
Version.
|
| Modifier | Constructor and Description |
|---|---|
protected |
GridCacheMapEntry(GridCacheContext<?,?> cctx,
KeyCacheObject key,
int hash,
CacheObject val) |
| Modifier and Type | Method and Description |
|---|---|
GridCacheMvccCandidate |
candidate(GridCacheVersion ver)
Gets lock candidate for given lock ID.
|
GridCacheMvccCandidate |
candidate(UUID nodeId,
long threadId) |
protected void |
checkObsolete() |
boolean |
checkSerializableReadVersion(GridCacheVersion serReadVer)
Checks if there was read/write conflict in serializable transaction.
|
boolean |
clear(GridCacheVersion ver,
boolean readers)
Marks entry as obsolete and, if possible or required, removes it
from swap storage.
|
protected void |
clearIndex(CacheObject prevVal)
Clears index.
|
protected void |
clearReader(UUID nodeId) |
protected void |
clearReaders() |
<K,V> GridCacheContext<K,V> |
context() |
protected void |
decrementMapPublicSize()
Decrements public size of map.
|
boolean |
deleted()
Note: this method works only for cache configured in ATOMIC mode or for cache that is
data center replication target.
|
protected boolean |
deletedUnlocked() |
protected void |
deletedUnlocked(boolean deleted) |
boolean |
detached() |
boolean |
equals(Object o) |
GridCacheBatchSwapEntry |
evictInBatchInternal(GridCacheVersion obsoleteVer)
Evicts entry when batch evict is performed.
|
boolean |
evictInternal(boolean swap,
GridCacheVersion obsoleteVer,
CacheEntryPredicate[] filter) |
protected boolean |
evictionDisabled() |
long |
expireTime() |
long |
expireTimeExtras() |
long |
expireTimeUnlocked() |
int |
hashCode() |
boolean |
hasLockCandidate(GridCacheVersion ver)
Checks if the candidate is either owner or pending.
|
boolean |
hasLockCandidate(long threadId)
Checks if the candidate is either owner or pending.
|
boolean |
hasLockCandidateUnsafe(GridCacheVersion ver) |
protected boolean |
hasOffHeapPointer() |
protected boolean |
hasReaders() |
boolean |
hasValue() |
protected boolean |
hasValueUnlocked() |
protected void |
incrementMapPublicSize()
Increments public size of map.
|
GridCacheEntryInfo |
info() |
boolean |
initialValue(CacheObject val,
GridCacheVersion ver,
long ttl,
long expireTime,
boolean preload,
AffinityTopologyVersion topVer,
GridDrType drType,
boolean fromStore)
Sets new value if current version is 0
|
boolean |
initialValue(KeyCacheObject key,
GridCacheSwapEntry unswapped)
Sets new value if current version is 0 using swap entry data.
|
CacheObject |
innerGet(GridCacheVersion ver,
IgniteInternalTx tx,
boolean readSwap,
boolean readThrough,
boolean updateMetrics,
boolean evt,
boolean tmp,
UUID subjId,
Object transformClo,
String taskName,
IgniteCacheExpiryPolicy expirePlc,
boolean keepBinary) |
T2<CacheObject,GridCacheVersion> |
innerGetVersioned(GridCacheVersion ver,
IgniteInternalTx tx,
boolean readSwap,
boolean unmarshal,
boolean updateMetrics,
boolean evt,
UUID subjId,
Object transformClo,
String taskName,
IgniteCacheExpiryPolicy expiryPlc,
boolean keepBinary) |
CacheObject |
innerReload()
Reloads entry from underlying storage.
|
GridCacheUpdateTxResult |
innerRemove(IgniteInternalTx tx,
UUID evtNodeId,
UUID affNodeId,
boolean retval,
boolean evt,
boolean metrics,
boolean keepBinary,
AffinityTopologyVersion topVer,
CacheEntryPredicate[] filter,
GridDrType drType,
GridCacheVersion explicitVer,
UUID subjId,
String taskName,
GridCacheVersion dhtVer,
Long updateCntr) |
GridCacheUpdateTxResult |
innerSet(IgniteInternalTx tx,
UUID evtNodeId,
UUID affNodeId,
CacheObject val,
boolean writeThrough,
boolean retval,
long ttl,
boolean evt,
boolean metrics,
boolean keepBinary,
AffinityTopologyVersion topVer,
CacheEntryPredicate[] filter,
GridDrType drType,
long drExpireTime,
GridCacheVersion explicitVer,
UUID subjId,
String taskName,
GridCacheVersion dhtVer,
Long updateCntr) |
GridCacheUpdateAtomicResult |
innerUpdate(GridCacheVersion newVer,
UUID evtNodeId,
UUID affNodeId,
GridCacheOperation op,
Object writeObj,
Object[] invokeArgs,
boolean writeThrough,
boolean readThrough,
boolean retval,
boolean keepBinary,
IgniteCacheExpiryPolicy expiryPlc,
boolean evt,
boolean metrics,
boolean primary,
boolean verCheck,
AffinityTopologyVersion topVer,
CacheEntryPredicate[] filter,
GridDrType drType,
long explicitTtl,
long explicitExpireTime,
GridCacheVersion conflictVer,
boolean conflictResolve,
boolean intercept,
UUID subjId,
String taskName,
CacheObject prevVal,
Long updateCntr,
GridDhtAtomicUpdateFuture fut) |
GridTuple3<Boolean,Object,javax.cache.processor.EntryProcessorResult<Object>> |
innerUpdateLocal(GridCacheVersion ver,
GridCacheOperation op,
Object writeObj,
Object[] invokeArgs,
boolean writeThrough,
boolean readThrough,
boolean retval,
boolean keepBinary,
javax.cache.expiry.ExpiryPolicy expiryPlc,
boolean evt,
boolean metrics,
CacheEntryPredicate[] filter,
boolean intercept,
UUID subjId,
String taskName)
Update method for local cache in atomic mode.
|
boolean |
invalidate(CacheEntryPredicate[] filter)
Invalidates this entry if it passes given filter.
|
boolean |
invalidate(GridCacheVersion curVer,
GridCacheVersion newVer)
Invalidates this entry.
|
boolean |
isDht() |
boolean |
isInternal() |
boolean |
isLocal() |
boolean |
isNear() |
boolean |
isNew()
Checks if entry is new assuming lock is held externally.
|
boolean |
isNewLocked()
Checks if entry is new while holding lock.
|
protected boolean |
isOffHeapValuesOnly() |
boolean |
isReplicated() |
boolean |
isStartVersion() |
KeyCacheObject |
key() |
protected Object |
keyValue(boolean cpy) |
GridCacheMvccCandidate |
localCandidate(long threadId) |
Collection<GridCacheMvccCandidate> |
localCandidates(GridCacheVersion... exclude)
Gets all local candidates.
|
GridCacheMvccCandidate |
localOwner() |
boolean |
lockedBy(GridCacheVersion ver) |
boolean |
lockedByAny(GridCacheVersion... exclude) |
boolean |
lockedByThread() |
boolean |
lockedByThread(long threadId) |
boolean |
lockedByThread(long threadId,
GridCacheVersion exclude) |
boolean |
lockedByThreadUnsafe(long threadId)
Will not fail for removed entries.
|
boolean |
lockedByUnsafe(GridCacheVersion ver) |
boolean |
lockedLocally(GridCacheVersion lockVer) |
boolean |
lockedLocallyByIdOrThread(GridCacheVersion lockVer,
long threadId) |
boolean |
lockedLocallyUnsafe(GridCacheVersion lockVer) |
boolean |
markObsolete(GridCacheVersion ver)
Sets obsolete flag if possible.
|
protected boolean |
markObsolete0(GridCacheVersion ver,
boolean clear,
GridCacheObsoleteEntryExtras extras)
Note that
onMarkedObsolete() should always be called after this method
returns true. |
boolean |
markObsoleteIfEmpty(GridCacheVersion obsoleteVer)
Sets obsolete flag if entry value is
null or entry is expired and no
locks are held. |
boolean |
markObsoleteVersion(GridCacheVersion ver)
Sets obsolete flag if entry version equals to
ver. |
int |
memorySize() |
List<GridCacheMvccCandidate> |
mvccAllLocal() |
protected GridCacheMvcc |
mvccExtras() |
protected void |
mvccExtras(GridCacheMvcc mvcc) |
boolean |
obsolete() |
boolean |
obsolete(GridCacheVersion exclude) |
boolean |
obsoleteOrDeleted() |
GridCacheVersion |
obsoleteVersion() |
protected GridCacheVersion |
obsoleteVersionExtras() |
protected void |
obsoleteVersionExtras(GridCacheVersion obsoleteVer,
GridCacheObsoleteEntryExtras ext) |
protected long |
offHeapPointer() |
protected void |
offHeapPointer(long valPtr) |
protected void |
onInvalidate()
Called when entry invalidated.
|
void |
onMarkedObsolete()
This method should be called each time entry is marked obsolete
other than by calling
GridCacheEntryEx.markObsolete(GridCacheVersion). |
boolean |
onOffheapEvict(byte[] entry,
GridCacheVersion evictVer,
GridCacheVersion obsoleteVer)
Called when entry should be evicted from offheap.
|
boolean |
onTtlExpired(GridCacheVersion obsoleteVer)
Callback from ttl processor to cache entry indicating that entry is expired.
|
void |
onUnlock()
Calls
GridDhtLocalPartition.onUnlock() for this entry's partition. |
int |
partition() |
boolean |
partitionValid() |
CacheObject |
peek(boolean heap,
boolean offheap,
boolean swap,
AffinityTopologyVersion topVer,
IgniteCacheExpiryPolicy expiryPlc)
Peeks into entry without loading value or updating statistics.
|
CacheObject |
peek(boolean heap,
boolean offheap,
boolean swap,
IgniteCacheExpiryPolicy plc)
Peeks into entry without loading value or updating statistics.
|
CacheObject |
peekVisibleValue()
Peeks value provided to public API entries and to entry filters.
|
long |
rawExpireTime() |
CacheObject |
rawGet() |
CacheObject |
rawGetOrUnmarshal(boolean tmp) |
CacheObject |
rawGetOrUnmarshalUnlocked(boolean tmp) |
CacheObject |
rawPut(CacheObject val,
long ttl) |
long |
rawTtl() |
protected Object |
readThrough(IgniteInternalTx tx,
KeyCacheObject key,
boolean reload,
UUID subjId,
String taskName) |
protected void |
recordNodeId(UUID nodeId,
AffinityTopologyVersion topVer) |
protected void |
releaseSwap() |
Collection<GridCacheMvccCandidate> |
remoteMvccSnapshot(GridCacheVersion... exclude)
Gets all remote versions.
|
protected CacheObject |
saveValueForIndexUnlocked()
This method will return current value only if clearIndex(V) will require previous value.
|
long |
startVersion() |
String |
toString() |
long |
ttl() |
protected void |
ttlAndExpireTimeExtras(long ttl,
long expireTime) |
long |
ttlExtras() |
IgniteTxKey |
txKey() |
CacheObject |
unswap() |
CacheObject |
unswap(boolean needVal)
Unswap ignoring flags.
|
protected CacheObject |
unswap(boolean needVal,
boolean checkExpire)
Unswaps an entry.
|
protected void |
update(CacheObject val,
long expireTime,
long ttl,
GridCacheVersion ver,
boolean addTracked) |
protected void |
updateIndex(CacheObject val,
long expireTime,
GridCacheVersion ver,
CacheObject prevVal)
Updates cache index.
|
void |
updateTtl(GridCacheVersion ver,
long ttl) |
protected void |
updateTtl(long ttl) |
boolean |
valid(AffinityTopologyVersion topVer) |
protected void |
value(CacheObject val)
Sets entry value.
|
CacheObject |
valueBytes() |
CacheObject |
valueBytes(GridCacheVersion ver)
Gets cached serialized value bytes.
|
protected IgniteBiTuple<byte[],Byte> |
valueBytes0() |
protected CacheObject |
valueBytesUnlocked() |
GridCacheVersion |
version() |
GridCacheVersionedEntryEx |
versionedEntry(boolean keepBinary)
Create versioned entry for this cache entry.
|
GridCacheVersion |
versionedValue(CacheObject val,
GridCacheVersion curVer,
GridCacheVersion newVer)
Sets new value if passed in version matches the current version
(used for read-through only).
|
boolean |
visitable(CacheEntryPredicate[] filter) |
<K,V> javax.cache.Cache.Entry<K,V> |
wrap()
Wraps this map entry into cache entry.
|
<K,V> EvictableEntry<K,V> |
wrapEviction() |
<K,V> javax.cache.Cache.Entry<K,V> |
wrapLazyValue(boolean keepBinary)
Wraps entry to an entry with lazy value get.
|
<K,V> CacheEntryImplEx<K,V> |
wrapVersioned() |
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, readExternalMeta, removeAllMeta, removeMeta, removeMeta, replaceMeta, writeExternalMetafinalize, getClass, notify, notifyAll, wait, wait, waitaddMeta, hasMeta, meta, putMetaIfAbsent, removeLock, removeMeta, removeMeta, replaceMeta, tmLock, txUnlockpublic static final GridCacheAtomicVersionComparator ATOMIC_VER_COMPARATOR
protected static final AtomicReference<IgniteLogger> logRef
protected static volatile IgniteLogger log
@GridToStringExclude protected final GridCacheContext<?,?> cctx
@GridToStringInclude protected final KeyCacheObject key
@GridToStringInclude protected CacheObject val
@GridToStringInclude protected final long startVer
@GridToStringInclude protected GridCacheVersion ver
@GridToStringInclude protected byte flags
IS_DELETED_MASKIS_UNSWAPPED_MASKprotected GridCacheMapEntry(GridCacheContext<?,?> cctx, KeyCacheObject key, int hash, CacheObject val)
cctx - Cache context.key - Cache key.hash - Key hash value.val - Entry value.public long startVersion()
startVersion in interface GridCacheEntryExprotected void value(@Nullable
CacheObject val)
val - Value to store.protected CacheObject valueBytesUnlocked()
public int memorySize()
throws IgniteCheckedException
memorySize in interface GridCacheEntryExIgniteCheckedException - If failed.public boolean isInternal()
isInternal in interface GridCacheEntryExTrue if entry is internal cache entry.public boolean isDht()
isDht in interface GridCacheEntryExTrue if DHT.public boolean isLocal()
isLocal in interface GridCacheEntryExTrue if local.public boolean isNear()
isNear in interface GridCacheEntryExTrue if near.public boolean isReplicated()
isReplicated in interface GridCacheEntryExTrue if replicated.public boolean detached()
detached in interface GridCacheEntryExFalse if entry belongs to cache map, true if this entry was created in colocated
cache and node is not primary for this key.public <K,V> GridCacheContext<K,V> context()
context in interface GridCacheEntryExpublic boolean isNew()
throws GridCacheEntryRemovedException
isNew in interface GridCacheEntryExTrue if entry is new.GridCacheEntryRemovedException - If entry was removed.public boolean isNewLocked()
throws GridCacheEntryRemovedException
isNewLocked in interface GridCacheEntryExTrue if entry is new.GridCacheEntryRemovedException - If entry was removed.public boolean isStartVersion()
True if start version.public boolean valid(AffinityTopologyVersion topVer)
valid in interface GridCacheEntryExtopVer - Topology version where validation should be performed.
When negative the latest available topology should be used.public int partition()
partition in interface GridCacheEntryExpublic boolean partitionValid()
partitionValid in interface GridCacheEntryExTrue if partition is in valid.@Nullable public GridCacheEntryInfo info()
info in interface GridCacheEntryExpublic boolean onOffheapEvict(byte[] entry,
GridCacheVersion evictVer,
GridCacheVersion obsoleteVer)
throws IgniteCheckedException,
GridCacheEntryRemovedException
If swap is enabled tries to do offheap -> swap eviction, otherwise evicted value should be passed to query manager.
onOffheapEvict in interface GridCacheEntryExentry - Serialized swap entry.evictVer - Version when entry was selected for eviction.obsoleteVer - Obsolete version.True if entry was obsoleted and written to swap.IgniteCheckedException - If failed.GridCacheEntryRemovedException - If entry was removed.public final CacheObject unswap() throws IgniteCheckedException, GridCacheEntryRemovedException
unswap in interface GridCacheEntryExIgniteCheckedException - If failed to read from swap storage.GridCacheEntryRemovedException - If entry was removed.@Nullable public final CacheObject unswap(boolean needVal) throws IgniteCheckedException, GridCacheEntryRemovedException
unswap in interface GridCacheEntryExneedVal - If false then do not need to deserialize value during unswap.IgniteCheckedException - If failed.GridCacheEntryRemovedException - If entry was removed.@Nullable protected CacheObject unswap(boolean needVal, boolean checkExpire) throws IgniteCheckedException, GridCacheEntryRemovedException
needVal - If false then do not to deserialize value during unswap.checkExpire - If true checks for expiration, as result entry can be obsoleted or marked deleted.IgniteCheckedException - If failed.GridCacheEntryRemovedException - If entry was removed.protected IgniteBiTuple<byte[],Byte> valueBytes0()
protected final void releaseSwap()
throws IgniteCheckedException
IgniteCheckedException - If failed.@Nullable protected Object readThrough(@Nullable IgniteInternalTx tx, KeyCacheObject key, boolean reload, UUID subjId, String taskName) throws IgniteCheckedException
tx - Transaction.key - Key.reload - flag.subjId - Subject ID.taskName - Task name.IgniteCheckedException - If failed.@Nullable public final CacheObject innerGet(@Nullable GridCacheVersion ver, @Nullable IgniteInternalTx tx, boolean readSwap, boolean readThrough, boolean updateMetrics, boolean evt, boolean tmp, UUID subjId, Object transformClo, String taskName, @Nullable IgniteCacheExpiryPolicy expirePlc, boolean keepBinary) throws IgniteCheckedException, GridCacheEntryRemovedException
innerGet in interface GridCacheEntryExver - Cache version to set. The version will be used on updating entry instead of generated one.tx - Ongoing transaction (possibly null).readSwap - Flag indicating whether to check swap memory.readThrough - Flag indicating whether to read through.updateMetrics - If true then metrics should be updated.evt - Flag to signal event notification.tmp - If true can return temporary instance which is valid while entry lock is held,
temporary object can used for filter evaluation or transform closure execution and
should not be returned to user.subjId - Subject ID initiated this read.transformClo - Transform closure to record event.taskName - Task name.expirePlc - Expiry policy.keepBinary - Keep binary flag.IgniteCheckedException - If loading value failed.GridCacheEntryRemovedException - If entry was removed.@Nullable public T2<CacheObject,GridCacheVersion> innerGetVersioned(@Nullable GridCacheVersion ver, IgniteInternalTx tx, boolean readSwap, boolean unmarshal, boolean updateMetrics, boolean evt, UUID subjId, Object transformClo, String taskName, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary) throws IgniteCheckedException, GridCacheEntryRemovedException
innerGetVersioned in interface GridCacheEntryExver - Cache version to set. The version will be used on updating entry instead of generated one.tx - Cache transaction.readSwap - Flag indicating whether to check swap memory.unmarshal - Unmarshal flag.updateMetrics - If true then metrics should be updated.evt - Flag to signal event notification.subjId - Subject ID initiated this read.transformClo - Transform closure to record event.taskName - Task name.expiryPlc - Expiry policy.keepBinary - Keep binary flag.IgniteCheckedException - If loading value failed.GridCacheEntryRemovedException - If entry was removed.@Nullable public final CacheObject innerReload() throws IgniteCheckedException, GridCacheEntryRemovedException
innerReload in interface GridCacheEntryExIgniteCheckedException - If reload failed.GridCacheEntryRemovedException - If entry has been removed.protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer)
nodeId - Node ID.public final GridCacheUpdateTxResult innerSet(@Nullable IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, CacheObject val, boolean writeThrough, boolean retval, long ttl, boolean evt, boolean metrics, boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, long drExpireTime, @Nullable GridCacheVersion explicitVer, @Nullable UUID subjId, String taskName, @Nullable GridCacheVersion dhtVer, @Nullable Long updateCntr) throws IgniteCheckedException, GridCacheEntryRemovedException
innerSet in interface GridCacheEntryExtx - Cache transaction.evtNodeId - ID of node responsible for this change.affNodeId - Partitioned node iD.val - Value to set.writeThrough - If true then persist to storage.retval - True if value should be returned (and unmarshalled if needed).ttl - Time to live.evt - Flag to signal event notification.metrics - Flag to signal metrics update.keepBinary - Keep binary flag.topVer - Topology version.filter - Filter.drType - DR type.drExpireTime - DR expire time (if any).explicitVer - Explicit version (if any).subjId - Subject ID initiated this update.taskName - Task name.dhtVer - Dht version for near cache entry.updateCntr - Update counter.false,
then value is null.IgniteCheckedException - If storing value failed.GridCacheEntryRemovedException - If entry has been removed.protected Object keyValue(boolean cpy)
cpy - Copy flag.public final GridCacheUpdateTxResult innerRemove(@Nullable IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, boolean retval, boolean evt, boolean metrics, boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @Nullable GridCacheVersion explicitVer, @Nullable UUID subjId, String taskName, @Nullable GridCacheVersion dhtVer, @Nullable Long updateCntr) throws IgniteCheckedException, GridCacheEntryRemovedException
innerRemove in interface GridCacheEntryExtx - Cache transaction.evtNodeId - ID of node responsible for this change.affNodeId - Partitioned node iD.retval - True if value should be returned (and unmarshalled if needed).evt - Flag to signal event notification.metrics - Flag to signal metrics notification.keepBinary - Keep binary flag.topVer - Topology version.filter - Filter.drType - DR type.explicitVer - Explicit version (if any).subjId - Subject ID initiated this update.taskName - Task name.dhtVer - Dht version for near cache entry.false,
then value is null.IgniteCheckedException - If remove failed.GridCacheEntryRemovedException - If entry has been removed.public GridTuple3<Boolean,Object,javax.cache.processor.EntryProcessorResult<Object>> innerUpdateLocal(GridCacheVersion ver, GridCacheOperation op, @Nullable Object writeObj, @Nullable Object[] invokeArgs, boolean writeThrough, boolean readThrough, boolean retval, boolean keepBinary, @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc, boolean evt, boolean metrics, @Nullable CacheEntryPredicate[] filter, boolean intercept, @Nullable UUID subjId, String taskName) throws IgniteCheckedException, GridCacheEntryRemovedException
innerUpdateLocal in interface GridCacheEntryExver - Cache version.op - Operation.writeObj - Value. Type depends on operation.invokeArgs - Optional arguments for EntryProcessor.writeThrough - Write through flag.readThrough - Read through flag.retval - Return value flag.expiryPlc - Expiry policy..evt - Event flag.metrics - Metrics update flag.filter - Optional filter to check.intercept - If true then calls cache interceptor.subjId - Subject ID initiated this update.taskName - Task name.IgniteCheckedException - If update failed.GridCacheEntryRemovedException - If entry is obsolete.public GridCacheUpdateAtomicResult innerUpdate(GridCacheVersion newVer, UUID evtNodeId, UUID affNodeId, GridCacheOperation op, @Nullable Object writeObj, @Nullable Object[] invokeArgs, boolean writeThrough, boolean readThrough, boolean retval, boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, boolean primary, boolean verCheck, AffinityTopologyVersion topVer, @Nullable CacheEntryPredicate[] filter, GridDrType drType, long explicitTtl, long explicitExpireTime, @Nullable GridCacheVersion conflictVer, boolean conflictResolve, boolean intercept, @Nullable UUID subjId, String taskName, @Nullable CacheObject prevVal, @Nullable Long updateCntr, @Nullable GridDhtAtomicUpdateFuture fut) throws IgniteCheckedException, GridCacheEntryRemovedException, GridClosureException
innerUpdate in interface GridCacheEntryExnewVer - Cache version to set. Entry will be updated only if current version is less then passed version.evtNodeId - Event node ID.affNodeId - Affinity node ID.op - Update operation.writeObj - Value. Type depends on operation.invokeArgs - Optional arguments for entry processor.writeThrough - Write through flag.readThrough - Read through flag.retval - Return value flag.expiryPlc - Expiry policy.evt - Event flag.metrics - Metrics update flag.primary - If update is performed on primary node (the one which assigns version).verCheck - Whether update should check current version and ignore update if current version is
greater than passed in.topVer - Topology version.filter - Optional filter to check.drType - DR type.explicitTtl - Conflict TTL (if any).explicitExpireTime - Conflict expire time (if any).conflictVer - DR version (if any).conflictResolve - If true then performs conflicts resolution.intercept - If true then calls cache interceptor.subjId - Subject ID initiated this update.taskName - Task name.updateCntr - Update counter.fut - Dht atomic future.null if conflict resolution was not performed, the last boolean - whether update should be
propagated to backups or not.IgniteCheckedException - If update failed.GridCacheEntryRemovedException - If entry is obsolete.GridClosureExceptionprotected boolean hasReaders()
throws GridCacheEntryRemovedException
true if entry has readers. It makes sense only for dht entry.GridCacheEntryRemovedException - If removed.protected void clearReaders()
protected void clearReader(UUID nodeId) throws GridCacheEntryRemovedException
nodeId - Node ID to clear.GridCacheEntryRemovedException - If removed.public boolean clear(GridCacheVersion ver, boolean readers) throws IgniteCheckedException
clear in interface GridCacheEntryExver - Obsolete version.readers - Flag to clear readers as well.True if entry was not being used, passed the filter and could be removed.IgniteCheckedException - If failed to remove from swap.public GridCacheVersion obsoleteVersion()
obsoleteVersion in interface GridCacheEntryExpublic boolean markObsolete(GridCacheVersion ver)
markObsolete in interface GridCacheEntryExver - Version to set as obsolete.True if entry is obsolete, false if
entry is still used by other threads or nodes.public boolean markObsoleteIfEmpty(@Nullable
GridCacheVersion obsoleteVer)
throws IgniteCheckedException
null or entry is expired and no
locks are held.markObsoleteIfEmpty in interface GridCacheEntryExobsoleteVer - Version to set as obsolete.True if entry was marked obsolete.IgniteCheckedException - If failed.public boolean markObsoleteVersion(GridCacheVersion ver)
ver.markObsoleteVersion in interface GridCacheEntryExver - Version to compare with.True if marked obsolete.protected boolean evictionDisabled()
True if this entry should not be evicted from cache.protected final boolean markObsolete0(GridCacheVersion ver, boolean clear, GridCacheObsoleteEntryExtras extras)
Note that onMarkedObsolete() should always be called after this method
returns true.
ver - Version.clear - True to clear.extras - Predefined extras.True if entry is obsolete, false if entry is still used by other threads or nodes.public void onMarkedObsolete()
GridCacheEntryEx.markObsolete(GridCacheVersion).onMarkedObsolete in interface GridCacheEntryExpublic final boolean obsolete()
obsolete in interface GridCacheEntryExTrue if entry is obsolete.public final boolean obsolete(GridCacheVersion exclude)
obsolete in interface GridCacheEntryExexclude - Obsolete version to ignore.True if obsolete version is not null and is not the
passed in version.public boolean invalidate(@Nullable
GridCacheVersion curVer,
GridCacheVersion newVer)
throws IgniteCheckedException
invalidate in interface GridCacheEntryExcurVer - Current version to match (null means always match).newVer - New version to set.true if entry is obsolete.IgniteCheckedException - If swap could not be released.protected void onInvalidate()
public boolean invalidate(@Nullable
CacheEntryPredicate[] filter)
throws GridCacheEntryRemovedException,
IgniteCheckedException
invalidate in interface GridCacheEntryExfilter - Optional filter that entry should pass before invalidation.true if entry was actually invalidated.GridCacheEntryRemovedException - If entry was removed.IgniteCheckedException - If swap could not be released.protected final void update(@Nullable
CacheObject val,
long expireTime,
long ttl,
GridCacheVersion ver,
boolean addTracked)
val - New value.expireTime - Expiration time.ttl - Time to live.ver - Update version.protected void updateTtl(long ttl)
ttl - Time to live.protected final boolean isOffHeapValuesOnly()
True if values should be stored off-heap.protected void checkObsolete()
throws GridCacheEntryRemovedException
GridCacheEntryRemovedException - If entry is obsolete.public KeyCacheObject key()
key in interface GridCacheEntryExpublic IgniteTxKey txKey()
txKey in interface GridCacheEntryExpublic GridCacheVersion version() throws GridCacheEntryRemovedException
version in interface GridCacheEntryExGridCacheEntryRemovedException - If entry has been removed.public boolean checkSerializableReadVersion(GridCacheVersion serReadVer) throws GridCacheEntryRemovedException
checkSerializableReadVersion in interface GridCacheEntryExserReadVer - Version read in serializable transaction.True if version check passed.GridCacheEntryRemovedException - If entry has been removed.@Nullable public CacheObject peek(boolean heap, boolean offheap, boolean swap, AffinityTopologyVersion topVer, @Nullable IgniteCacheExpiryPolicy expiryPlc) throws GridCacheEntryRemovedException, IgniteCheckedException
peek in interface GridCacheEntryExheap - Read from heap flag.offheap - Read from offheap flag.swap - Read from swap flag.topVer - Topology version.expiryPlc - Expiry policy if TTL should be updated.GridCacheEntryRemovedException - If entry has been removed.IgniteCheckedException - If failed.@Nullable public CacheObject peek(boolean heap, boolean offheap, boolean swap, @Nullable IgniteCacheExpiryPolicy plc) throws GridCacheEntryRemovedException, IgniteCheckedException
peek in interface GridCacheEntryExheap - Read from heap flag.offheap - Read from offheap flag.swap - Read from swap flag.plc - Expiry policy if TTL should be updated.GridCacheEntryRemovedException - If entry has been removed.IgniteCheckedException - If failed.public CacheObject rawGet()
rawGet in interface GridCacheEntryEx@Nullable public CacheObject rawGetOrUnmarshal(boolean tmp) throws IgniteCheckedException
rawGetOrUnmarshal in interface GridCacheEntryExtmp - If true can return temporary instance which is valid while entry lock is held,
temporary object can used for filter evaluation or transform closure execution and
should not be returned to user.IgniteCheckedException - If failed.@Nullable public CacheObject rawGetOrUnmarshalUnlocked(boolean tmp) throws IgniteCheckedException
tmp - If true can return temporary instance.IgniteCheckedException - If failed.public boolean hasValue()
hasValue in interface GridCacheEntryExTrue if has value or value bytes.protected boolean hasValueUnlocked()
True if this entry has value.public CacheObject rawPut(CacheObject val, long ttl)
rawPut in interface GridCacheEntryExval - New value.ttl - Time to live.public boolean initialValue(CacheObject val, GridCacheVersion ver, long ttl, long expireTime, boolean preload, AffinityTopologyVersion topVer, GridDrType drType, boolean fromStore) throws IgniteCheckedException, GridCacheEntryRemovedException
initialValue in interface GridCacheEntryExval - New value.ver - Version to use.ttl - Time to live.expireTime - Expiration time.preload - Flag indicating whether entry is being preloaded.topVer - Topology version.drType - DR type.fromStore - True if value was loaded from store.True if initial value was set.IgniteCheckedException - In case of error.GridCacheEntryRemovedException - If entry was removed.public boolean initialValue(KeyCacheObject key, GridCacheSwapEntry unswapped) throws IgniteCheckedException, GridCacheEntryRemovedException
initialValue in interface GridCacheEntryExkey - Key.unswapped - Swap entry to set entry state from.True if initial value was set.IgniteCheckedException - In case of error.GridCacheEntryRemovedException - If entry was removed.public GridCacheVersionedEntryEx versionedEntry(boolean keepBinary) throws IgniteCheckedException, GridCacheEntryRemovedException
versionedEntry in interface GridCacheEntryExkeepBinary - Keep binary flag.IgniteCheckedException - In case of error.GridCacheEntryRemovedException - If entry was removed.public GridCacheVersion versionedValue(CacheObject val, GridCacheVersion curVer, GridCacheVersion newVer) throws IgniteCheckedException, GridCacheEntryRemovedException
versionedValue in interface GridCacheEntryExval - New value.curVer - Version to match or null if match is not required.newVer - Version to set.IgniteCheckedException - If index could not be updated.GridCacheEntryRemovedException - If entry was removed.public boolean hasLockCandidate(GridCacheVersion ver) throws GridCacheEntryRemovedException
hasLockCandidate in interface GridCacheEntryExver - Candidate version to check.True if the candidate is either owner or pending.GridCacheEntryRemovedException - If entry was removed.public boolean hasLockCandidate(long threadId)
throws GridCacheEntryRemovedException
hasLockCandidate in interface GridCacheEntryExthreadId - ThreadId.True if the candidate is either owner or pending.GridCacheEntryRemovedException - If entry was removed.public boolean lockedByAny(GridCacheVersion... exclude) throws GridCacheEntryRemovedException
lockedByAny in interface GridCacheEntryExexclude - Exclude versions.True if lock is owned by any thread or node.GridCacheEntryRemovedException - If entry was removed.public boolean lockedByThread()
throws GridCacheEntryRemovedException
lockedByThread in interface GridCacheEntryExTrue if lock is owned by current thread.GridCacheEntryRemovedException - If entry was removed.public boolean lockedLocally(GridCacheVersion lockVer) throws GridCacheEntryRemovedException
lockedLocally in interface GridCacheEntryExlockVer - Lock ID to check.True if lock is owned by candidate.GridCacheEntryRemovedException - If entry was removed.public boolean lockedByThread(long threadId,
GridCacheVersion exclude)
throws GridCacheEntryRemovedException
lockedByThread in interface GridCacheEntryExthreadId - Thread ID to check.exclude - Version to exclude from check.True if lock is owned by given thread.GridCacheEntryRemovedException - If entry was removed.public boolean lockedLocallyByIdOrThread(GridCacheVersion lockVer, long threadId) throws GridCacheEntryRemovedException
lockedLocallyByIdOrThread in interface GridCacheEntryExlockVer - Lock ID.threadId - Thread ID.True if locked either locally or by thread.GridCacheEntryRemovedException - If removed.public boolean lockedByThread(long threadId)
throws GridCacheEntryRemovedException
lockedByThread in interface GridCacheEntryExthreadId - Thread ID to check.True if lock is owned by given thread.GridCacheEntryRemovedException - If entry was removed.public boolean lockedBy(GridCacheVersion ver) throws GridCacheEntryRemovedException
lockedBy in interface GridCacheEntryExver - Version to check for ownership.True if owner has the specified version.GridCacheEntryRemovedException - If entry was removed.public boolean lockedByThreadUnsafe(long threadId)
lockedByThreadUnsafe in interface GridCacheEntryExthreadId - Thread ID to check.True if lock is owned by given thread.public boolean lockedByUnsafe(GridCacheVersion ver)
lockedByUnsafe in interface GridCacheEntryExver - Version to check for ownership.True if owner has the specified version.public boolean lockedLocallyUnsafe(GridCacheVersion lockVer)
lockedLocallyUnsafe in interface GridCacheEntryExlockVer - Lock ID to check.True if lock is owned by candidate.public boolean hasLockCandidateUnsafe(GridCacheVersion ver)
hasLockCandidateUnsafe in interface GridCacheEntryExver - Lock version to check.True if has candidate with given lock ID.public Collection<GridCacheMvccCandidate> localCandidates(GridCacheVersion... exclude) throws GridCacheEntryRemovedException
localCandidates in interface GridCacheEntryExexclude - Versions to exclude from check.GridCacheEntryRemovedException - If entry was removed.public Collection<GridCacheMvccCandidate> remoteMvccSnapshot(GridCacheVersion... exclude)
remoteMvccSnapshot in interface GridCacheEntryExexclude - Exclude version.@Nullable public GridCacheMvccCandidate candidate(GridCacheVersion ver) throws GridCacheEntryRemovedException
candidate in interface GridCacheEntryExver - Lock version.GridCacheEntryRemovedException - If entry was removed.public GridCacheMvccCandidate localCandidate(long threadId) throws GridCacheEntryRemovedException
localCandidate in interface GridCacheEntryExthreadId - Thread ID.GridCacheEntryRemovedException - If entry was removed.public GridCacheMvccCandidate candidate(UUID nodeId, long threadId) throws GridCacheEntryRemovedException
candidate in interface GridCacheEntryExnodeId - Node ID.threadId - Thread ID.GridCacheEntryRemovedException - If entry was removed.public GridCacheMvccCandidate localOwner() throws GridCacheEntryRemovedException
localOwner in interface GridCacheEntryExGridCacheEntryRemovedException - If entry was removed.public long rawExpireTime()
rawExpireTime in interface GridCacheEntryExpublic long expireTimeUnlocked()
expireTimeUnlocked in interface GridCacheEntryExpublic boolean onTtlExpired(GridCacheVersion obsoleteVer) throws GridCacheEntryRemovedException
onTtlExpired in interface GridCacheEntryExobsoleteVer - Version to set obsolete if entry is expired.True if this entry was expired as a result of this call.GridCacheEntryRemovedException - If entry was removed.public long rawTtl()
rawTtl in interface GridCacheEntryExpublic long expireTime()
throws GridCacheEntryRemovedException
expireTime in interface GridCacheEntryExGridCacheEntryRemovedException - If entry was removed.public long ttl()
throws GridCacheEntryRemovedException
ttl in interface GridCacheEntryExGridCacheEntryRemovedException - If entry was removed.public void updateTtl(@Nullable
GridCacheVersion ver,
long ttl)
throws GridCacheEntryRemovedException
updateTtl in interface GridCacheEntryExver - Version.ttl - Time to live.GridCacheEntryRemovedExceptionpublic CacheObject valueBytes() throws GridCacheEntryRemovedException
valueBytes in interface GridCacheEntryExGridCacheEntryRemovedException - If entry was removed.@Nullable public CacheObject valueBytes(@Nullable GridCacheVersion ver) throws IgniteCheckedException, GridCacheEntryRemovedException
valueBytes in interface GridCacheEntryExver - Version for which to get value bytes.IgniteCheckedException - If serialization failed.GridCacheEntryRemovedException - If entry was removed.protected void updateIndex(@Nullable
CacheObject val,
long expireTime,
GridCacheVersion ver,
@Nullable
CacheObject prevVal)
throws IgniteCheckedException
val - Value.expireTime - Expire time.ver - New entry version.prevVal - Previous value.IgniteCheckedException - If update failed.protected void clearIndex(CacheObject prevVal) throws IgniteCheckedException
prevVal - Previous value (if needed for index update).IgniteCheckedException - If failed.protected final CacheObject saveValueForIndexUnlocked() throws IgniteCheckedException
null.null.IgniteCheckedException - If failed to retrieve previous value.public <K,V> javax.cache.Cache.Entry<K,V> wrap()
wrap in interface GridCacheEntryExpublic <K,V> javax.cache.Cache.Entry<K,V> wrapLazyValue(boolean keepBinary)
wrapLazyValue in interface GridCacheEntryExkeepBinary - Keep binary flag.@Nullable public CacheObject peekVisibleValue()
peekVisibleValue in interface GridCacheEntryExpublic <K,V> EvictableEntry<K,V> wrapEviction()
wrapEviction in interface GridCacheEntryExpublic <K,V> CacheEntryImplEx<K,V> wrapVersioned()
wrapVersioned in interface GridCacheEntryExpublic boolean evictInternal(boolean swap,
GridCacheVersion obsoleteVer,
@Nullable
CacheEntryPredicate[] filter)
throws IgniteCheckedException
evictInternal in interface GridCacheEntryExswap - Swap flag.obsoleteVer - Version for eviction.filter - Optional filter.True if entry could be evicted.IgniteCheckedException - In case of error.public GridCacheBatchSwapEntry evictInBatchInternal(GridCacheVersion obsoleteVer) throws IgniteCheckedException
evictInBatchInternal in interface GridCacheEntryExobsoleteVer - Version to mark obsolete with.null if entry was not evicted.IgniteCheckedException - If failed.public boolean visitable(CacheEntryPredicate[] filter)
filter - Entry filter.True if entry is visitable.public boolean deleted()
deleted in interface GridCacheEntryExTrue if entry has been already deleted.public boolean obsoleteOrDeleted()
obsoleteOrDeleted in interface GridCacheEntryExTrue if entry is obsolete or deleted.GridCacheEntryEx.deleted()protected boolean deletedUnlocked()
True if deleted.protected void deletedUnlocked(boolean deleted)
deleted - True if deleted.protected void incrementMapPublicSize()
protected void decrementMapPublicSize()
@Nullable protected GridCacheMvcc mvccExtras()
@Nullable public List<GridCacheMvccCandidate> mvccAllLocal()
protected void mvccExtras(@Nullable
GridCacheMvcc mvcc)
mvcc - MVCC.@Nullable protected GridCacheVersion obsoleteVersionExtras()
protected void obsoleteVersionExtras(@Nullable
GridCacheVersion obsoleteVer,
GridCacheObsoleteEntryExtras ext)
obsoleteVer - Obsolete version.public long ttlExtras()
public long expireTimeExtras()
protected void ttlAndExpireTimeExtras(long ttl,
long expireTime)
ttl - TTL.expireTime - Expire time.protected boolean hasOffHeapPointer()
protected long offHeapPointer()
protected void offHeapPointer(long valPtr)
valPtr - Off-heap value pointer.public void onUnlock()
GridDhtLocalPartition.onUnlock() for this entry's partition.onUnlock in interface GridCacheEntryEx
Follow @ApacheIgnite
Ignite Fabric : ver. 1.7.0 Release Date : August 1 2016