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.
|
static int |
DFLT_LOCK_TIMEOUT_ENV |
static String |
ENTRY_LOCK_TIMEOUT_ENV
Property name for entry lock timeout in milliseconds.
|
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 CacheObject |
val
Value.
|
protected GridCacheVersion |
ver
Version.
|
Modifier | Constructor and Description |
---|---|
protected |
GridCacheMapEntry(GridCacheContext<?,?> cctx,
KeyCacheObject key) |
Modifier and Type | Method and Description |
---|---|
@Nullable List<GridCacheEntryInfo> |
allVersionsInfo() |
@Nullable GridCacheMvccCandidate |
candidate(GridCacheVersion ver)
Gets lock candidate for given lock ID.
|
GridCacheMvccCandidate |
candidate(UUID nodeId,
long threadId) |
protected void |
checkObsolete() |
protected void |
checkOwnerChanged(@Nullable CacheLockCandidates prevOwners,
@Nullable CacheLockCandidates owners,
CacheObject val) |
protected void |
checkOwnerChanged(@Nullable CacheLockCandidates prevOwners,
@Nullable CacheLockCandidates owners,
CacheObject val,
boolean inThreadChain) |
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() |
boolean |
equals(Object o) |
boolean |
evictInternal(GridCacheVersion obsoleteVer,
@Nullable 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.
|
@Nullable GridCacheEntryInfo |
info() |
boolean |
initialValue(CacheObject val,
GridCacheVersion ver,
MvccVersion mvccVer,
MvccVersion newMvccVer,
byte mvccTxState,
byte newMvccTxState,
long ttl,
long expireTime,
boolean preload,
AffinityTopologyVersion topVer,
GridDrType drType,
boolean fromStore,
CacheDataRow row)
Sets new value if current version is 0
|
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) |
EntryGetResult |
innerGetAndReserveForLoad(boolean updateMetrics,
boolean evt,
UUID subjId,
String taskName,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean keepBinary,
@Nullable ReaderArguments readerArgs) |
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) |
@Nullable CacheObject |
innerReload()
Reloads entry from underlying storage.
|
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) |
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) |
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,
boolean transformOp) |
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,
boolean transformOp)
Update method for local cache in atomic mode.
|
boolean |
invalidate(GridCacheVersion newVer)
Invalidates this entry.
|
boolean |
isDht() |
boolean |
isInternal() |
boolean |
isLocal() |
boolean |
isMvcc() |
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 |
lockedByCurrentThread()
Tests whether the entry is locked currently.
|
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) |
void |
lockEntry()
Locks entry to protect from concurrent access.
|
protected WALPointer |
logMvccUpdate(IgniteInternalTx tx,
CacheObject val,
long expireTime,
long updCntr,
MvccSnapshot mvccVer) |
protected WALPointer |
logTxUpdate(IgniteInternalTx tx,
CacheObject val,
long expireTime,
long updCntr) |
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(@Nullable 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() |
@Nullable List<GridCacheMvccCandidate> |
mvccAllLocal() |
protected @Nullable GridCacheMvcc |
mvccExtras() |
protected void |
mvccExtras(@Nullable GridCacheMvcc mvcc) |
GridCacheUpdateTxResult |
mvccLock(GridDhtTxLocalAdapter tx,
MvccSnapshot mvccVer) |
@Nullable CacheObject |
mvccPeek(boolean onheapOnly)
Retrieves the last committed MVCC entry version.
|
boolean |
mvccPreloadEntry(List<GridCacheMvccEntryInfo> entryHist)
Apply entry history if not exists.
|
GridCacheUpdateTxResult |
mvccRemove(IgniteInternalTx tx,
UUID affNodeId,
AffinityTopologyVersion topVer,
MvccSnapshot mvccVer,
boolean needHistory,
boolean needOldVal,
@Nullable CacheEntryPredicate filter,
boolean retVal) |
GridCacheUpdateTxResult |
mvccSet(IgniteInternalTx tx,
UUID affNodeId,
CacheObject val,
javax.cache.processor.EntryProcessor entryProc,
Object[] invokeArgs,
long ttl0,
AffinityTopologyVersion topVer,
MvccSnapshot mvccVer,
GridCacheOperation op,
boolean needHistory,
boolean noCreate,
boolean needOldVal,
CacheEntryPredicate filter,
boolean retVal,
boolean keepBinary) |
GridCacheUpdateTxResult |
mvccUpdateRowsWithPreloadInfo(IgniteInternalTx tx,
UUID affNodeId,
AffinityTopologyVersion topVer,
List<GridCacheEntryInfo> entries,
GridCacheOperation op,
MvccSnapshot mvccVer,
IgniteUuid futId,
int batchNum) |
protected long |
nextPartitionCounter(AffinityTopologyVersion topVer,
boolean primary,
boolean initial,
@Nullable Long primaryCntr) |
protected long |
nextPartitionCounter(IgniteInternalTx tx,
@Nullable Long updateCntr) |
boolean |
obsolete() |
boolean |
obsolete(GridCacheVersion exclude) |
boolean |
obsoleteOrDeleted() |
GridCacheVersion |
obsoleteVersion() |
protected @Nullable 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() |
@Nullable CacheObject |
peek()
Peeks into entry without loading value or updating statistics.
|
@Nullable CacheObject |
peek(boolean heap,
boolean offheap,
AffinityTopologyVersion topVer,
@Nullable IgniteCacheExpiryPolicy expiryPlc)
Peeks into entry without loading value or updating statistics.
|
@Nullable 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 @Nullable Object |
readThrough(@Nullable 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.
|
protected boolean |
storeValue(@Nullable CacheObject val,
long expireTime,
GridCacheVersion ver)
Stores value in offheap.
|
protected boolean |
storeValue(@Nullable CacheObject val,
long expireTime,
GridCacheVersion ver,
@Nullable IgnitePredicate<CacheDataRow> predicate,
@Nullable CacheDataRow row)
Stores value in off-heap.
|
String |
toString() |
protected String |
toStringWithTryLock(Supplier<String> dfltToStr)
Does thread safe
toString() for GridCacheMapEntry classes. |
void |
touch()
Touch this entry in its context's eviction manager.
|
boolean |
tryLockEntry(long timeout)
Locks entry to protect from concurrent access.
|
long |
ttl() |
protected void |
ttlAndExpireTimeExtras(long ttl,
long expireTime) |
long |
ttlExtras() |
IgniteTxKey |
txKey() |
void |
txUnlock(IgniteInternalTx tx)
Unlocks acquired lock.
|
void |
unlockEntry()
Unlocks entry previously locked by
GridCacheEntryEx.lockEntry() . |
CacheObject |
unswap() |
@Nullable CacheObject |
unswap(boolean needVal)
Unswap ignoring flags.
|
CacheObject |
unswap(CacheDataRow row) |
protected @Nullable CacheDataRow |
unswap(@Nullable CacheDataRow row,
boolean checkExpire)
Unswaps an entry.
|
protected void |
update(@Nullable CacheObject val,
long expireTime,
long ttl,
GridCacheVersion ver,
boolean addTracked) |
void |
updateIndex(SchemaIndexCacheVisitorClosure clo)
Update index from within entry lock, passing key, value, and expiration time to provided closure.
|
protected void |
updatePlatformCache(@Nullable CacheObject val,
@Nullable AffinityTopologyVersion ver)
Invokes platform cache update callback, if applicable.
|
void |
updateTtl(@Nullable GridCacheVersion ver,
long ttl) |
boolean |
valid(AffinityTopologyVersion topVer) |
protected void |
value(@Nullable CacheObject val)
Sets entry value.
|
CacheObject |
valueBytes() |
@Nullable CacheObject |
valueBytes(@Nullable 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,
@Nullable IgniteCacheExpiryPolicy loadExpiryPlc,
@Nullable 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, removeAllMeta, removeMeta, removeMeta, replaceMeta
finalize, getClass, notify, notifyAll, wait, wait, wait
addMeta, hasMeta, initialValue, initialValue, meta, putMetaIfAbsent, removeLock, removeMeta, removeMeta, replaceMeta, tmLock
public static final GridCacheAtomicVersionComparator ATOMIC_VER_COMPARATOR
public static final int DFLT_LOCK_TIMEOUT_ENV
ENTRY_LOCK_TIMEOUT
,
Constant Field Values@SystemProperty(value="Sets the entry\'s lock timeout in milliseconds", type=java.lang.Long.class, defaults="1000") public static final String ENTRY_LOCK_TIMEOUT_ENV
protected static final AtomicReference<IgniteLogger> logRef
protected static volatile IgniteLogger log
@GridToStringExclude protected final GridCacheContext<?,?> cctx
@GridToStringInclude(sensitive=true) protected final KeyCacheObject key
@GridToStringInclude(sensitive=true) protected CacheObject val
@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.protected void value(@Nullable @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 isMvcc()
isMvcc
in interface GridCacheEntryEx
True
if this is n entry from MVCC cache.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 @Nullable GridCacheEntryInfo info()
info
in interface GridCacheEntryEx
@Nullable public @Nullable List<GridCacheEntryInfo> allVersionsInfo() throws IgniteCheckedException
allVersionsInfo
in interface GridCacheEntryEx
IgniteCheckedException
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 @Nullable 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 @Nullable CacheDataRow unswap(@Nullable @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 @Nullable Object readThrough(@Nullable @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.public final CacheObject innerGet(@Nullable @Nullable GridCacheVersion ver, @Nullable @Nullable IgniteInternalTx tx, boolean readThrough, boolean updateMetrics, boolean evt, UUID subjId, Object transformClo, String taskName, @Nullable @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 @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary, @Nullable @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 @Nullable GridCacheVersion ver, IgniteInternalTx tx, boolean updateMetrics, boolean evt, UUID subjId, Object transformClo, String taskName, @Nullable @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary, @Nullable @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 @Nullable 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 mvccSet(IgniteInternalTx tx, UUID affNodeId, CacheObject val, javax.cache.processor.EntryProcessor entryProc, Object[] invokeArgs, long ttl0, AffinityTopologyVersion topVer, MvccSnapshot mvccVer, GridCacheOperation op, boolean needHistory, boolean noCreate, boolean needOldVal, CacheEntryPredicate filter, boolean retVal, boolean keepBinary) throws IgniteCheckedException, GridCacheEntryRemovedException
mvccSet
in interface GridCacheEntryEx
tx
- Cache transaction.affNodeId
- Partitioned node iD.val
- Value to set.entryProc
- Entry processor.invokeArgs
- Entry processor invoke arguments.ttl0
- TTL.topVer
- Topology version.mvccVer
- Mvcc version.op
- Cache operation.needHistory
- Whether to collect rows created or affected by the current tx.noCreate
- Entry should not be created when enabled, e.g. SQL INSERT.needOldVal
- Flag if it is need to return the old value (value before current tx has been started).filter
- Filter.retVal
- Previous value return flag.keepBinary
- Keep binary flag.false
,
then value is null
.IgniteCheckedException
- If storing value failed.GridCacheEntryRemovedException
- If entry has been removed.public final GridCacheUpdateTxResult mvccRemove(IgniteInternalTx tx, UUID affNodeId, AffinityTopologyVersion topVer, MvccSnapshot mvccVer, boolean needHistory, boolean needOldVal, @Nullable @Nullable CacheEntryPredicate filter, boolean retVal) throws IgniteCheckedException, GridCacheEntryRemovedException
mvccRemove
in interface GridCacheEntryEx
tx
- Cache transaction.affNodeId
- Partitioned node iD.topVer
- Topology version.mvccVer
- Mvcc version.needHistory
- Whether to collect rows created or affected by the current tx.needOldVal
- Flag if it is need to return the old value (value before current tx has been started).filter
- Filter.retVal
- Previous value return flag.false
,
then value is null
.IgniteCheckedException
- If storing value failed.GridCacheEntryRemovedException
- If entry has been removed.public GridCacheUpdateTxResult mvccLock(GridDhtTxLocalAdapter tx, MvccSnapshot mvccVer) throws GridCacheEntryRemovedException, IgniteCheckedException
mvccLock
in interface GridCacheEntryEx
tx
- Transaction adapter.mvccVer
- Mvcc version.GridCacheEntryRemovedException
- If entry has been removed.IgniteCheckedException
- If locking failedpublic final GridCacheUpdateTxResult innerSet(@Nullable @Nullable IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, CacheObject val, boolean writeThrough, boolean retval, long ttl, boolean evt, boolean metrics, boolean keepBinary, boolean oldValPresent, @Nullable @Nullable CacheObject oldVal, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, long drExpireTime, @Nullable @Nullable GridCacheVersion explicitVer, @Nullable @Nullable UUID subjId, String taskName, @Nullable @Nullable GridCacheVersion dhtVer, @Nullable @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 @Nullable IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, boolean retval, boolean evt, boolean metrics, boolean keepBinary, boolean oldValPresent, @Nullable @Nullable CacheObject oldVal, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @Nullable @Nullable GridCacheVersion explicitVer, @Nullable @Nullable UUID subjId, String taskName, @Nullable @Nullable GridCacheVersion dhtVer, @Nullable @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 @Nullable Object writeObj, @Nullable @Nullable Object[] invokeArgs, boolean writeThrough, boolean readThrough, boolean retval, boolean keepBinary, @Nullable @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc, boolean evt, boolean metrics, @Nullable @Nullable CacheEntryPredicate[] filter, boolean intercept, @Nullable @Nullable UUID subjId, String taskName, boolean transformOp) 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.transformOp
- True
if transform operation caused update.IgniteCheckedException
- If update failed.GridCacheEntryRemovedException
- If entry is obsolete.public GridCacheUpdateAtomicResult innerUpdate(GridCacheVersion newVer, UUID evtNodeId, UUID affNodeId, GridCacheOperation op, @Nullable @Nullable Object writeObj, @Nullable @Nullable Object[] invokeArgs, boolean writeThrough, boolean readThrough, boolean retval, boolean keepBinary, @Nullable @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, boolean primary, boolean verCheck, AffinityTopologyVersion topVer, @Nullable @Nullable CacheEntryPredicate[] filter, GridDrType drType, long explicitTtl, long explicitExpireTime, @Nullable @Nullable GridCacheVersion conflictVer, boolean conflictResolve, boolean intercept, @Nullable @Nullable UUID subjId, String taskName, @Nullable @Nullable CacheObject prevVal, @Nullable @Nullable Long updateCntr, @Nullable @Nullable GridDhtAtomicAbstractUpdateFuture fut, boolean transformOp) 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.transformOp
- True
if transform operation caused update.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 @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 @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 @Nullable CacheObject mvccPeek(boolean onheapOnly) throws GridCacheEntryRemovedException, IgniteCheckedException
mvccPeek
in interface GridCacheEntryEx
onheapOnly
- True
if a specified peek mode instructs to look only in the on-heap storage.null
otherwise.GridCacheEntryRemovedException
- If entry has been removed.IgniteCheckedException
- If failed.@Nullable public @Nullable CacheObject peek(boolean heap, boolean offheap, AffinityTopologyVersion topVer, @Nullable @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 @Nullable CacheObject peek() throws GridCacheEntryRemovedException, IgniteCheckedException
peek
in interface GridCacheEntryEx
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, MvccVersion mvccVer, MvccVersion newMvccVer, byte mvccTxState, byte newMvccTxState, long ttl, long expireTime, boolean preload, AffinityTopologyVersion topVer, GridDrType drType, boolean fromStore, CacheDataRow row) throws IgniteCheckedException, GridCacheEntryRemovedException
initialValue
in interface GridCacheEntryEx
val
- New value.ver
- Version to use.mvccVer
- Mvcc version.newMvccVer
- New mvcc version.mvccTxState
- Tx state hint for mvcc version.newMvccTxState
- Tx state hint for new mvcc version.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.row
- Pre-created data row, associated with this cache entry.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, boolean initial, @Nullable @Nullable Long primaryCntr)
topVer
- Topology version for current operation.primary
- Primary node update flag.initial
- True
if initial value.primaryCntr
- Counter assigned on primary node.protected long nextPartitionCounter(IgniteInternalTx tx, @Nullable @Nullable Long updateCntr)
tx
- Tx.updateCntr
- Update counter.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 @Nullable IgniteCacheExpiryPolicy loadExpiryPlc, @Nullable @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 @Nullable 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 @Nullable GridCacheVersion ver, long ttl) throws GridCacheEntryRemovedException
updateTtl
in interface GridCacheEntryEx
ver
- Version.ttl
- Time to live.GridCacheEntryRemovedException
public CacheObject valueBytes() throws GridCacheEntryRemovedException
valueBytes
in interface GridCacheEntryEx
GridCacheEntryRemovedException
- If entry was removed.@Nullable public @Nullable CacheObject valueBytes(@Nullable @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 boolean storeValue(@Nullable @Nullable CacheObject val, long expireTime, GridCacheVersion ver) throws IgniteCheckedException
val
- Value.expireTime
- Expire time.ver
- New entry version.IgniteCheckedException
- If update failed.protected boolean storeValue(@Nullable @Nullable CacheObject val, long expireTime, GridCacheVersion ver, @Nullable @Nullable IgnitePredicate<CacheDataRow> predicate, @Nullable @Nullable CacheDataRow row) throws IgniteCheckedException
val
- Value.expireTime
- Expire time.ver
- New entry version.predicate
- Optional predicate.row
- Pre-created data row, associated with this cache entry.True
if storage was modified.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 WALPointer logTxUpdate(IgniteInternalTx tx, CacheObject val, long expireTime, long updCntr) throws IgniteCheckedException
tx
- Transaction.val
- Value.expireTime
- Expire time (or 0 if not applicable).updCntr
- Update counter.IgniteCheckedException
- In case of log failure.protected WALPointer logMvccUpdate(IgniteInternalTx tx, CacheObject val, long expireTime, long updCntr, MvccSnapshot mvccVer) throws IgniteCheckedException
tx
- Transaction.val
- Value.expireTime
- Expire time (or 0 if not applicable). *updCntr
- Update counter.mvccVer
- Mvcc version.IgniteCheckedException
- In case of log failure.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 @Nullable CacheObject peekVisibleValue()
peekVisibleValue
in interface GridCacheEntryEx
public void updateIndex(SchemaIndexCacheVisitorClosure clo) throws IgniteCheckedException, GridCacheEntryRemovedException
updateIndex
in interface GridCacheEntryEx
clo
- Closure to apply to key, value, and expiration time.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 @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 @Nullable GridCacheMvcc mvccExtras()
@Nullable public final @Nullable List<GridCacheMvccCandidate> mvccAllLocal()
protected final void mvccExtras(@Nullable @Nullable GridCacheMvcc mvcc)
mvcc
- MVCC.@Nullable protected final @Nullable GridCacheVersion obsoleteVersionExtras()
protected final void checkOwnerChanged(@Nullable @Nullable CacheLockCandidates prevOwners, @Nullable @Nullable CacheLockCandidates owners, CacheObject val)
prevOwners
- Previous owners.owners
- Current owners.val
- Entry value.protected final void checkOwnerChanged(@Nullable @Nullable CacheLockCandidates prevOwners, @Nullable @Nullable CacheLockCandidates owners, CacheObject val, boolean inThreadChain)
prevOwners
- Previous owners.owners
- Current owners.val
- Entry value.inThreadChain
- True
if called during thread chain checking.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 txUnlock(IgniteInternalTx tx) throws GridCacheEntryRemovedException
txUnlock
in interface GridCacheEntryEx
tx
- Cache transaction.GridCacheEntryRemovedException
- If this entry has been removed from cache.public void onUnlock()
GridDhtLocalPartition.onUnlock()
for this entry's partition.onUnlock
in interface GridCacheEntryEx
public void lockEntry()
lockEntry
in interface GridCacheEntryEx
GridCacheEntryEx.unlockEntry().
public boolean tryLockEntry(long timeout)
tryLockEntry
in interface GridCacheEntryEx
timeout
- period of waiting in millis;true
if the lock was free and was acquired by the current thread, or the lock was already held by
the current thread; and false
if the waiting time elapsed before the lock could be acquiredGridCacheEntryEx.unlockEntry().
public void unlockEntry()
GridCacheEntryEx.lockEntry()
.unlockEntry
in interface GridCacheEntryEx
public boolean lockedByCurrentThread()
lockedByCurrentThread
in interface GridCacheEntryEx
True
if the entry is locked.GridCacheEntryEx.lockEntry().
,
GridCacheEntryEx.unlockEntry().
public void touch()
touch
in interface GridCacheEntryEx
protected String toStringWithTryLock(Supplier<String> dfltToStr)
toString()
for GridCacheMapEntry
classes.dfltToStr
- toString()
supplier.GridCacheMapEntry
.public GridCacheUpdateTxResult mvccUpdateRowsWithPreloadInfo(IgniteInternalTx tx, UUID affNodeId, AffinityTopologyVersion topVer, List<GridCacheEntryInfo> entries, GridCacheOperation op, MvccSnapshot mvccVer, IgniteUuid futId, int batchNum) throws IgniteCheckedException, GridCacheEntryRemovedException
mvccUpdateRowsWithPreloadInfo
in interface GridCacheEntryEx
tx
- Transaction.affNodeId
- Affinity node id.topVer
- Topology version.entries
- Entries.op
- Cache operation.mvccVer
- Mvcc version.futId
- Future id.batchNum
- Batch number.IgniteCheckedException
GridCacheEntryRemovedException
public boolean mvccPreloadEntry(List<GridCacheMvccEntryInfo> entryHist) throws IgniteCheckedException, GridCacheEntryRemovedException
mvccPreloadEntry
in interface GridCacheEntryEx
entryHist
- Entries.True
if initial value was set.IgniteCheckedException
GridCacheEntryRemovedException
protected void updatePlatformCache(@Nullable @Nullable CacheObject val, @Nullable @Nullable AffinityTopologyVersion ver)
val
- Updated value, null on remove.ver
- Topology version, null on remove.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021