Package org.infinispan.container.entries
Class RepeatableReadEntry
- java.lang.Object
-
- org.infinispan.container.entries.ReadCommittedEntry
-
- org.infinispan.container.entries.RepeatableReadEntry
-
- All Implemented Interfaces:
Cloneable
,Map.Entry
,CacheEntry
,MetadataAware
,MVCCEntry
,StateChangingEntry
- Direct Known Subclasses:
VersionedRepeatableReadEntry
public class RepeatableReadEntry extends ReadCommittedEntry
An extension ofReadCommittedEntry
that provides Repeatable Read semantics- Since:
- 4.0
- Author:
- Manik Surtani (manik@jboss.org)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.infinispan.container.entries.ReadCommittedEntry
ReadCommittedEntry.Flags
-
-
Constructor Summary
Constructors Constructor Description RepeatableReadEntry(Object key, Object value, Metadata metadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepeatableReadEntry
clone()
Metadata
getOldMetadata()
Object
getOldValue()
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.void
resetCurrentValue()
Reset the current value of the entry to the value before the commmand was executed the first time.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
setSkipLookup(boolean skipLookup)
Object
setValue(Object value)
Sets the value of the entry, returning the previous valueboolean
skipLookup()
void
updatePreviousValue()
Update the previous value of the entry - set it to current value.-
Methods inherited from class org.infinispan.container.entries.ReadCommittedEntry
commit, commit, getCreated, getKey, getLastUsed, getLifespan, getMaxIdle, getMetadata, getValue, isChanged, isCommitted, isCreated, isEvicted, isExpired, isLoaded, isNull, isRemoved, setChanged, setCommitted, setCreated, setCreated, setEvicted, setExpired, setFlag, setLastUsed, setLoaded, setMetadata, setRemoved, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.container.entries.CacheEntry
commit, isValid, rollback, setValid, undelete
-
Methods inherited from interface org.infinispan.container.entries.MVCCEntry
copyForUpdate, copyForUpdate
-
Methods inherited from interface org.infinispan.container.entries.StateChangingEntry
copyStateFlagsFrom, getStateFlags
-
-
-
-
Method Detail
-
setSkipLookup
public void setSkipLookup(boolean skipLookup)
Description copied from interface:CacheEntry
- Specified by:
setSkipLookup
in interfaceCacheEntry
- Overrides:
setSkipLookup
in classReadCommittedEntry
-
skipLookup
public boolean skipLookup()
- Specified by:
skipLookup
in interfaceCacheEntry
- Overrides:
skipLookup
in classReadCommittedEntry
- Returns:
true
if the value must not be fetch from an external source
-
clone
public RepeatableReadEntry clone()
- Specified by:
clone
in interfaceCacheEntry
- Specified by:
clone
in interfaceMVCCEntry
- Overrides:
clone
in classReadCommittedEntry
-
setValue
public final Object setValue(Object value)
Description copied from interface:CacheEntry
Sets the value of the entry, returning the previous value- Specified by:
setValue
in interfaceCacheEntry
- Specified by:
setValue
in interfaceMap.Entry
- Overrides:
setValue
in classReadCommittedEntry
- Parameters:
value
- value to set- Returns:
- previous value
-
resetCurrentValue
public void resetCurrentValue()
Description copied from interface:MVCCEntry
Reset the current value of the entry to the value before the commmand was executed the first time. This is invoked before the command is retried.- Specified by:
resetCurrentValue
in interfaceMVCCEntry
- Overrides:
resetCurrentValue
in classReadCommittedEntry
-
updatePreviousValue
public void updatePreviousValue()
Description copied from interface:MVCCEntry
Update the previous value of the entry - set it to current value. This is invoked when the command is successfuly finished (there won't be any more retries) or when the value was updated from external source.- Specified by:
updatePreviousValue
in interfaceMVCCEntry
- Overrides:
updatePreviousValue
in classReadCommittedEntry
-
getOldValue
public Object getOldValue()
-
getOldMetadata
public Metadata getOldMetadata()
-
setRead
public void setRead()
Description copied from interface:MVCCEntry
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. ReplacesCacheTransaction.addReadKey(Object)
.
-
isRead
public boolean isRead()
Description copied from interface:MVCCEntry
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. ReplacesCacheTransaction.keyRead(Object)
.
-
-