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) |
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() |
protected void |
checkOwnerChanged(CacheLockCandidates prevOwners,
CacheLockCandidates owners,
CacheObject val) |
boolean |
checkSerializableReadVersion(GridCacheVersion serReadVer)
Checks if there was read/write conflict in serializable transaction.
|
protected abstract void |
checkThreadChain(GridCacheMvccCandidate owner) |
boolean |
clear(GridCacheVersion ver,
boolean readers)
Marks entry as obsolete and, if possible or required, removes it
from swap storage.
|
protected void |
clearReader(UUID nodeId) |
protected void |
clearReaders() |
void |
clearReserveForLoad(GridCacheVersion ver) |
<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() |
void |
ensureIndexed()
Ensures that the value stored in the entry is also inserted in the indexing.
|
boolean |
equals(Object o) |
boolean |
evictInternal(GridCacheVersion obsoleteVer,
CacheEntryPredicate[] filter,
boolean evictOffheap) |
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 |
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
|
CacheObject |
innerGet(GridCacheVersion ver,
IgniteInternalTx tx,
boolean readThrough,
boolean updateMetrics,
boolean evt,
UUID subjId,
Object transformClo,
String taskName,
IgniteCacheExpiryPolicy expirePlc,
boolean keepBinary) |
EntryGetResult |
innerGetAndReserveForLoad(boolean updateMetrics,
boolean evt,
UUID subjId,
String taskName,
IgniteCacheExpiryPolicy expiryPlc,
boolean keepBinary,
ReaderArguments readerArgs) |
EntryGetResult |
innerGetVersioned(GridCacheVersion ver,
IgniteInternalTx tx,
boolean updateMetrics,
boolean evt,
UUID subjId,
Object transformClo,
String taskName,
IgniteCacheExpiryPolicy expiryPlc,
boolean keepBinary,
ReaderArguments readerArgs) |
CacheObject |
innerReload()
Reloads entry from underlying storage.
|
GridCacheUpdateTxResult |
innerRemove(IgniteInternalTx tx,
UUID evtNodeId,
UUID affNodeId,
boolean retval,
boolean evt,
boolean metrics,
boolean keepBinary,
boolean oldValPresent,
CacheObject oldVal,
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,
boolean oldValPresent,
CacheObject oldVal,
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,
GridDhtAtomicAbstractUpdateFuture 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(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.
|
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() |
protected GridDhtLocalPartition |
localPartition() |
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) |
protected void |
logUpdate(GridCacheOperation op,
CacheObject val,
GridCacheVersion writeVer,
long expireTime,
long updCntr) |
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) |
protected long |
nextPartitionCounter(AffinityTopologyVersion topVer,
boolean primary,
Long primaryCntr) |
boolean |
obsolete() |
boolean |
obsolete(GridCacheVersion exclude) |
boolean |
obsoleteOrDeleted() |
GridCacheVersion |
obsoleteVersion() |
protected GridCacheVersion |
obsoleteVersionExtras() |
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 |
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. |
protected void |
onUpdateFinished(long cntr) |
int |
partition() |
boolean |
partitionValid() |
CacheObject |
peek(boolean heap,
boolean offheap,
AffinityTopologyVersion topVer,
IgniteCacheExpiryPolicy expiryPlc)
Peeks into entry without loading value or updating statistics.
|
CacheObject |
peek(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 |
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) |
Collection<GridCacheMvccCandidate> |
remoteMvccSnapshot(GridCacheVersion... exclude)
Gets all remote versions.
|
protected void |
removeValue()
Removes value from offheap.
|
long |
startVersion() |
protected void |
storeValue(CacheObject val,
long expireTime,
GridCacheVersion ver,
CacheDataRow oldRow)
Stores value in offheap.
|
String |
toString() |
long |
ttl() |
protected void |
ttlAndExpireTimeExtras(long ttl,
long expireTime) |
long |
ttlExtras() |
IgniteTxKey |
txKey() |
CacheObject |
unswap() |
CacheObject |
unswap(boolean needVal)
Unswap ignoring flags.
|
CacheObject |
unswap(CacheDataRow row) |
protected CacheDataRow |
unswap(CacheDataRow row,
boolean checkExpire)
Unswaps an entry.
|
protected void |
update(CacheObject val,
long expireTime,
long ttl,
GridCacheVersion ver,
boolean addTracked) |
void |
updateIndex(SchemaIndexCacheVisitorClosure clo,
long link)
Update index from within entry lock, passing key, value, and expiration time to provided closure.
|
void |
updateTtl(GridCacheVersion ver,
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() |
GridCacheVersion |
version() |
GridCacheVersionedEntryEx |
versionedEntry(boolean keepBinary)
Create versioned entry for this cache entry.
|
EntryGetResult |
versionedValue(CacheObject val,
GridCacheVersion curVer,
GridCacheVersion newVer,
IgniteCacheExpiryPolicy loadExpiryPlc,
ReaderArguments readerArgs)
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, writeExternalMeta
finalize, getClass, notify, notifyAll, wait, wait, wait
addMeta, hasMeta, meta, putMetaIfAbsent, removeLock, removeMeta, removeMeta, replaceMeta, tmLock, txUnlock
public 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_MASK
IS_UNSWAPPED_MASK
protected GridCacheMapEntry(GridCacheContext<?,?> cctx, KeyCacheObject key)
cctx
- Cache context.key
- Cache key.public long startVersion()
startVersion
in interface GridCacheEntryEx
protected void value(@Nullable CacheObject val)
val
- Value to store.public int memorySize() throws IgniteCheckedException
memorySize
in interface GridCacheEntryEx
IgniteCheckedException
- If failed.public boolean isInternal()
isInternal
in interface GridCacheEntryEx
True
if entry is internal cache entry.public boolean isDht()
isDht
in interface GridCacheEntryEx
True
if DHT.public boolean isLocal()
isLocal
in interface GridCacheEntryEx
True
if local.public boolean isNear()
isNear
in interface GridCacheEntryEx
True
if near.public boolean isReplicated()
isReplicated
in interface GridCacheEntryEx
True
if replicated.public boolean detached()
detached
in interface GridCacheEntryEx
False
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 GridCacheEntryEx
public boolean isNew() throws GridCacheEntryRemovedException
isNew
in interface GridCacheEntryEx
True
if entry is new.GridCacheEntryRemovedException
- If entry was removed.public boolean isNewLocked() throws GridCacheEntryRemovedException
isNewLocked
in interface GridCacheEntryEx
True
if entry is new.GridCacheEntryRemovedException
- If entry was removed.public boolean isStartVersion()
True
if start version.public boolean valid(AffinityTopologyVersion topVer)
valid
in interface GridCacheEntryEx
topVer
- Topology version where validation should be performed.
When negative the latest available topology should be used.public int partition()
partition
in interface GridCacheEntryEx
protected GridDhtLocalPartition localPartition()
public boolean partitionValid()
partitionValid
in interface GridCacheEntryEx
True
if partition is in valid.@Nullable public GridCacheEntryInfo info()
info
in interface GridCacheEntryEx
public final CacheObject unswap() throws IgniteCheckedException, GridCacheEntryRemovedException
unswap
in interface GridCacheEntryEx
IgniteCheckedException
- If failed to read from swap storage.GridCacheEntryRemovedException
- If entry was removed.public final CacheObject unswap(CacheDataRow row) throws IgniteCheckedException, GridCacheEntryRemovedException
unswap
in interface GridCacheEntryEx
row
- Already extracted value.IgniteCheckedException
- 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 GridCacheEntryEx
needVal
- If false
then do not need to deserialize value during unswap.IgniteCheckedException
- If failed.GridCacheEntryRemovedException
- If entry was removed.@Nullable protected CacheDataRow unswap(@Nullable CacheDataRow row, boolean checkExpire) throws IgniteCheckedException, GridCacheEntryRemovedException
row
- Already extracted cache data.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()
@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 readThrough, boolean updateMetrics, boolean evt, UUID subjId, Object transformClo, String taskName, @Nullable IgniteCacheExpiryPolicy expirePlc, boolean keepBinary) throws IgniteCheckedException, GridCacheEntryRemovedException
innerGet
in interface GridCacheEntryEx
ver
- Cache version to set. The version will be used on updating entry instead of generated one.tx
- Ongoing transaction (possibly null).readThrough
- Flag indicating whether to read through.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.expirePlc
- Expiry policy.keepBinary
- Keep binary flag.IgniteCheckedException
- If loading value failed.GridCacheEntryRemovedException
- If entry was removed.public EntryGetResult innerGetAndReserveForLoad(boolean updateMetrics, boolean evt, UUID subjId, String taskName, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary, @Nullable ReaderArguments readerArgs) throws IgniteCheckedException, GridCacheEntryRemovedException
innerGetAndReserveForLoad
in interface GridCacheEntryEx
updateMetrics
- If true
then metrics should be updated.evt
- Flag to signal event notification.subjId
- Subject ID initiated this read.taskName
- Task name.expiryPlc
- Expiry policy.keepBinary
- Keep binary flag.readerArgs
- Reader will be added if not null.IgniteCheckedException
- If loading value failed.GridCacheEntryRemovedException
- If entry was removed.public EntryGetResult innerGetVersioned(@Nullable GridCacheVersion ver, IgniteInternalTx tx, boolean updateMetrics, boolean evt, UUID subjId, Object transformClo, String taskName, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary, @Nullable ReaderArguments readerArgs) throws IgniteCheckedException, GridCacheEntryRemovedException
innerGetVersioned
in interface GridCacheEntryEx
ver
- Cache version to set. The version will be used on updating entry instead of generated one.tx
- Cache transaction.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.readerArgs
- Reader will be added if not null.IgniteCheckedException
- If loading value failed.GridCacheEntryRemovedException
- If entry was removed.@Nullable public final CacheObject innerReload() throws IgniteCheckedException, GridCacheEntryRemovedException
innerReload
in interface GridCacheEntryEx
IgniteCheckedException
- 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, boolean oldValPresent, @Nullable CacheObject oldVal, 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 GridCacheEntryEx
tx
- 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.oldValPresent
- True
if oldValue present.oldVal
- Old value.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, boolean oldValPresent, @Nullable CacheObject oldVal, 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 GridCacheEntryEx
tx
- 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.oldValPresent
- True
if oldValue present.oldVal
- Old value.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 GridCacheEntryEx
ver
- 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 GridDhtAtomicAbstractUpdateFuture fut) throws IgniteCheckedException, GridCacheEntryRemovedException, GridClosureException
innerUpdate
in interface GridCacheEntryEx
newVer
- 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.GridClosureException
protected 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 GridCacheEntryEx
ver
- 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 GridCacheEntryEx
public boolean markObsolete(GridCacheVersion ver)
markObsolete
in interface GridCacheEntryEx
ver
- 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 GridCacheEntryEx
obsoleteVer
- Version to set as obsolete.True
if entry was marked obsolete.IgniteCheckedException
- If failed.public boolean markObsoleteVersion(GridCacheVersion ver)
ver
.markObsoleteVersion
in interface GridCacheEntryEx
ver
- 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 GridCacheEntryEx
public final boolean obsolete()
obsolete
in interface GridCacheEntryEx
True
if entry is obsolete.public final boolean obsolete(GridCacheVersion exclude)
obsolete
in interface GridCacheEntryEx
exclude
- Obsolete version to ignore.True
if obsolete version is not null
and is not the
passed in version.public boolean invalidate(GridCacheVersion newVer) throws IgniteCheckedException
invalidate
in interface GridCacheEntryEx
newVer
- New version to set.true
if entry is obsolete.IgniteCheckedException
- If swap could not be released.protected void onInvalidate()
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 checkObsolete() throws GridCacheEntryRemovedException
GridCacheEntryRemovedException
- If entry is obsolete.public KeyCacheObject key()
key
in interface GridCacheEntryEx
public IgniteTxKey txKey()
txKey
in interface GridCacheEntryEx
public GridCacheVersion version() throws GridCacheEntryRemovedException
version
in interface GridCacheEntryEx
GridCacheEntryRemovedException
- If entry has been removed.public boolean checkSerializableReadVersion(GridCacheVersion serReadVer) throws GridCacheEntryRemovedException
checkSerializableReadVersion
in interface GridCacheEntryEx
serReadVer
- Version read in serializable transaction.True
if version check passed.GridCacheEntryRemovedException
- If entry has been removed.@Nullable public CacheObject peek(boolean heap, boolean offheap, AffinityTopologyVersion topVer, @Nullable IgniteCacheExpiryPolicy expiryPlc) throws GridCacheEntryRemovedException, IgniteCheckedException
peek
in interface GridCacheEntryEx
heap
- Read from heap flag.offheap
- Read from offheap 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(@Nullable IgniteCacheExpiryPolicy plc) throws GridCacheEntryRemovedException, IgniteCheckedException
peek
in interface GridCacheEntryEx
plc
- Expiry policy if TTL should be updated.GridCacheEntryRemovedException
- If entry has been removed.IgniteCheckedException
- If failed.public CacheObject rawGet()
rawGet
in interface GridCacheEntryEx
public final boolean hasValue()
hasValue
in interface GridCacheEntryEx
True
if has value or value bytes.protected final boolean hasValueUnlocked()
True
if this entry has value.public CacheObject rawPut(CacheObject val, long ttl)
rawPut
in interface GridCacheEntryEx
val
- 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 GridCacheEntryEx
val
- 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.protected void onUpdateFinished(long cntr)
cntr
- Updated partition counter.protected long nextPartitionCounter(AffinityTopologyVersion topVer, boolean primary, @Nullable Long primaryCntr)
topVer
- Topology version for current operation.primary
- Primary node update flag.primaryCntr
- Counter assigned on primary node.public GridCacheVersionedEntryEx versionedEntry(boolean keepBinary) throws IgniteCheckedException, GridCacheEntryRemovedException
versionedEntry
in interface GridCacheEntryEx
keepBinary
- Keep binary flag.IgniteCheckedException
- In case of error.GridCacheEntryRemovedException
- If entry was removed.public void clearReserveForLoad(GridCacheVersion ver)
clearReserveForLoad
in interface GridCacheEntryEx
ver
- Expected entry version.public EntryGetResult versionedValue(CacheObject val, GridCacheVersion curVer, GridCacheVersion newVer, @Nullable IgniteCacheExpiryPolicy loadExpiryPlc, @Nullable ReaderArguments readerArgs) throws IgniteCheckedException, GridCacheEntryRemovedException
versionedValue
in interface GridCacheEntryEx
val
- New value.curVer
- Version to match or null
if match is not required.newVer
- Version to set.loadExpiryPlc
- Expiry policy if entry is loaded from store.readerArgs
- Reader will be added if not null.IgniteCheckedException
- If index could not be updated.GridCacheEntryRemovedException
- If entry was removed.public boolean hasLockCandidate(GridCacheVersion ver) throws GridCacheEntryRemovedException
hasLockCandidate
in interface GridCacheEntryEx
ver
- 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 GridCacheEntryEx
threadId
- 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 GridCacheEntryEx
exclude
- 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 GridCacheEntryEx
True
if lock is owned by current thread.GridCacheEntryRemovedException
- If entry was removed.public boolean lockedLocally(GridCacheVersion lockVer) throws GridCacheEntryRemovedException
lockedLocally
in interface GridCacheEntryEx
lockVer
- 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 GridCacheEntryEx
threadId
- 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 GridCacheEntryEx
lockVer
- 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 GridCacheEntryEx
threadId
- 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 GridCacheEntryEx
ver
- 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 GridCacheEntryEx
threadId
- Thread ID to check.True
if lock is owned by given thread.public boolean lockedByUnsafe(GridCacheVersion ver)
lockedByUnsafe
in interface GridCacheEntryEx
ver
- Version to check for ownership.True
if owner has the specified version.public boolean lockedLocallyUnsafe(GridCacheVersion lockVer)
lockedLocallyUnsafe
in interface GridCacheEntryEx
lockVer
- Lock ID to check.True
if lock is owned by candidate.public boolean hasLockCandidateUnsafe(GridCacheVersion ver)
hasLockCandidateUnsafe
in interface GridCacheEntryEx
ver
- Lock version to check.True
if has candidate with given lock ID.public Collection<GridCacheMvccCandidate> localCandidates(GridCacheVersion... exclude) throws GridCacheEntryRemovedException
localCandidates
in interface GridCacheEntryEx
exclude
- Versions to exclude from check.GridCacheEntryRemovedException
- If entry was removed.public Collection<GridCacheMvccCandidate> remoteMvccSnapshot(GridCacheVersion... exclude)
remoteMvccSnapshot
in interface GridCacheEntryEx
exclude
- Exclude version.@Nullable public GridCacheMvccCandidate candidate(GridCacheVersion ver) throws GridCacheEntryRemovedException
candidate
in interface GridCacheEntryEx
ver
- Lock version.GridCacheEntryRemovedException
- If entry was removed.public GridCacheMvccCandidate localCandidate(long threadId) throws GridCacheEntryRemovedException
localCandidate
in interface GridCacheEntryEx
threadId
- Thread ID.GridCacheEntryRemovedException
- If entry was removed.public GridCacheMvccCandidate candidate(UUID nodeId, long threadId) throws GridCacheEntryRemovedException
candidate
in interface GridCacheEntryEx
nodeId
- Node ID.threadId
- Thread ID.GridCacheEntryRemovedException
- If entry was removed.public GridCacheMvccCandidate localOwner() throws GridCacheEntryRemovedException
localOwner
in interface GridCacheEntryEx
GridCacheEntryRemovedException
- If entry was removed.public long rawExpireTime()
rawExpireTime
in interface GridCacheEntryEx
public long expireTimeUnlocked()
expireTimeUnlocked
in interface GridCacheEntryEx
public boolean onTtlExpired(GridCacheVersion obsoleteVer) throws GridCacheEntryRemovedException
onTtlExpired
in interface GridCacheEntryEx
obsoleteVer
- 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 GridCacheEntryEx
public long expireTime() throws GridCacheEntryRemovedException
expireTime
in interface GridCacheEntryEx
GridCacheEntryRemovedException
- If entry was removed.public long ttl() throws GridCacheEntryRemovedException
ttl
in interface GridCacheEntryEx
GridCacheEntryRemovedException
- If entry was removed.public void updateTtl(@Nullable GridCacheVersion ver, long ttl) throws GridCacheEntryRemovedException
updateTtl
in interface GridCacheEntryEx
ver
- Version.ttl
- Time to live.GridCacheEntryRemovedException
public void ensureIndexed() throws GridCacheEntryRemovedException, IgniteCheckedException
ensureIndexed
in interface GridCacheEntryEx
GridCacheEntryRemovedException
- If entry was removed.IgniteCheckedException
public CacheObject valueBytes() throws GridCacheEntryRemovedException
valueBytes
in interface GridCacheEntryEx
GridCacheEntryRemovedException
- If entry was removed.@Nullable public CacheObject valueBytes(@Nullable GridCacheVersion ver) throws IgniteCheckedException, GridCacheEntryRemovedException
valueBytes
in interface GridCacheEntryEx
ver
- Version for which to get value bytes.IgniteCheckedException
- If serialization failed.GridCacheEntryRemovedException
- If entry was removed.protected void storeValue(CacheObject val, long expireTime, GridCacheVersion ver, @Nullable CacheDataRow oldRow) throws IgniteCheckedException
val
- Value.expireTime
- Expire time.ver
- New entry version.oldRow
- Old row if available.IgniteCheckedException
- If update failed.protected void logUpdate(GridCacheOperation op, CacheObject val, GridCacheVersion writeVer, long expireTime, long updCntr) throws IgniteCheckedException
op
- Update operation.val
- Write value.writeVer
- Write version.expireTime
- Expire time.updCntr
- Update counter.IgniteCheckedException
protected void removeValue() throws IgniteCheckedException
IgniteCheckedException
- If failed.public <K,V> javax.cache.Cache.Entry<K,V> wrap()
wrap
in interface GridCacheEntryEx
public <K,V> javax.cache.Cache.Entry<K,V> wrapLazyValue(boolean keepBinary)
wrapLazyValue
in interface GridCacheEntryEx
keepBinary
- Keep binary flag.@Nullable public CacheObject peekVisibleValue()
peekVisibleValue
in interface GridCacheEntryEx
public void updateIndex(SchemaIndexCacheVisitorClosure clo, long link) throws IgniteCheckedException, GridCacheEntryRemovedException
updateIndex
in interface GridCacheEntryEx
clo
- Closure to apply to key, value, and expiration time.link
- Link.IgniteCheckedException
- If failed.GridCacheEntryRemovedException
- If entry was removed.public <K,V> EvictableEntry<K,V> wrapEviction()
wrapEviction
in interface GridCacheEntryEx
public <K,V> CacheEntryImplEx<K,V> wrapVersioned()
wrapVersioned
in interface GridCacheEntryEx
public boolean evictInternal(GridCacheVersion obsoleteVer, @Nullable CacheEntryPredicate[] filter, boolean evictOffheap) throws IgniteCheckedException
evictInternal
in interface GridCacheEntryEx
obsoleteVer
- Version for eviction.filter
- Optional filter.evictOffheap
- Evict offheap value flag.True
if entry could be evicted.IgniteCheckedException
- In case of error.public final boolean visitable(CacheEntryPredicate[] filter)
filter
- Entry filter.True
if entry is visitable.public final boolean deleted()
deleted
in interface GridCacheEntryEx
True
if entry has been already deleted.public final boolean obsoleteOrDeleted()
obsoleteOrDeleted
in interface GridCacheEntryEx
True
if entry is obsolete or deleted.GridCacheEntryEx.deleted()
protected final boolean deletedUnlocked()
True
if deleted.protected final void deletedUnlocked(boolean deleted)
deleted
- True
if deleted.protected void incrementMapPublicSize()
protected void decrementMapPublicSize()
@Nullable protected final GridCacheMvcc mvccExtras()
@Nullable public final List<GridCacheMvccCandidate> mvccAllLocal()
protected final void mvccExtras(@Nullable GridCacheMvcc mvcc)
mvcc
- MVCC.@Nullable protected final GridCacheVersion obsoleteVersionExtras()
protected final void checkOwnerChanged(@Nullable CacheLockCandidates prevOwners, @Nullable CacheLockCandidates owners, CacheObject val)
prevOwners
- Previous owners.owners
- Current owners.val
- Entry value.protected abstract void checkThreadChain(GridCacheMvccCandidate owner)
owner
- Starting candidate in the chain.public long ttlExtras()
public long expireTimeExtras()
protected void ttlAndExpireTimeExtras(long ttl, long expireTime)
ttl
- TTL.expireTime
- Expire time.public void onUnlock()
GridDhtLocalPartition.onUnlock()
for this entry's partition.onUnlock
in interface GridCacheEntryEx
Follow @ApacheIgnite
Ignite Fabric : ver. 2.3.0 Release Date : October 28 2017