Package org.infinispan.container.entries
Interface MVCCEntry<K,V>
- All Superinterfaces:
CacheEntry<K,
,V> Cloneable
,Map.Entry<K,
,V> MetadataAware
- All Known Implementing Classes:
ReadCommittedEntry
,RepeatableReadEntry
,VersionedRepeatableReadEntry
An entry that can be safely copied when updates are made, to provide MVCC semantics
- Since:
- 4.0
- Author:
- Manik Surtani
-
Method Summary
Modifier and TypeMethodDescriptionclone()
default boolean
boolean
Returns whether this entry was marked as being expired or notdefault boolean
isLoaded()
default boolean
isRead()
Check is this entry as loaded from the cache (as opposed to generated by the application using write-only command), mostly for purposes of the write skew check.boolean
void
Reset the current value of the entry to the value before the command was executed the first time.void
setChanged
(boolean isChanged) default void
Mark this context-entry as already committed to theDataContainer
.void
setExpired
(boolean expired) Marks this entry as being expired.default void
setLoaded
(boolean loaded) default void
setRead()
Mark that this entry was loaded from the cache (as opposed to generated by the application using write-only command), mostly for purposes of the write skew check.void
void
Update the previous value of the entry - set it to current value.Methods inherited from interface org.infinispan.container.entries.CacheEntry
commit, getCreated, getInternalMetadata, getKey, getLastUsed, getLifespan, getMaxIdle, getValue, isChanged, isCreated, isEvicted, isNull, isRemoved, setCreated, setCreated, setEvicted, setInternalMetadata, setLastUsed, setRemoved, setSkipLookup, setValue, skipLookup
Methods inherited from interface org.infinispan.container.entries.metadata.MetadataAware
getMetadata, setMetadata
-
Method Details
-
setChanged
void setChanged(boolean isChanged) - Specified by:
setChanged
in interfaceCacheEntry<K,
V>
-
setExpired
void setExpired(boolean expired) Marks this entry as being expired. This is a special form of removal.- Parameters:
expired
- whether or not this entry should be expired
-
isExpired
boolean isExpired()Returns whether this entry was marked as being expired or not- Returns:
- whether expired has been set
-
resetCurrentValue
void resetCurrentValue()Reset the current value of the entry to the value before the command was executed the first time. This is invoked before the command is retried. -
updatePreviousValue
void updatePreviousValue()Update the previous value of the entry - set it to current value. This is invoked when the command is successfully finished (there won't be any more retries) or when the value was updated from external source. -
getOldValue
V getOldValue()- Returns:
- The previous value.
-
getOldMetadata
Metadata getOldMetadata()- Returns:
- The previous metadata.
-
setRead
default void setRead()Mark that this entry was loaded from the cache (as opposed to generated by the application using write-only command), mostly for purposes of the write skew check. -
isRead
default boolean isRead()Check is this entry as loaded from the cache (as opposed to generated by the application using write-only command), mostly for purposes of the write skew check. -
setCommitted
default void setCommitted()Mark this context-entry as already committed to theDataContainer
. -
isCommitted
default boolean isCommitted()- Returns:
- True if this context entry has been committed to the
DataContainer
-
isLoaded
default boolean isLoaded()- Returns:
- True if we've checked persistence for presence of this entry.
-
setLoaded
default void setLoaded(boolean loaded) -
clone
- Specified by:
clone
in interfaceCacheEntry<K,
V>
-