public class ReadCommittedEntry extends Object implements MVCCEntry
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ReadCommittedEntry.Flags |
| Modifier and Type | Field and Description |
|---|---|
protected byte |
flags |
protected Object |
key |
protected Object |
oldValue |
protected Object |
value |
| Modifier | Constructor and Description |
|---|---|
protected |
ReadCommittedEntry() |
|
ReadCommittedEntry(Object key,
Object value,
EntryVersion version,
long lifespan) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit(DataContainer container,
EntryVersion newVersion)
Commits changes
|
void |
copyForUpdate(DataContainer container,
boolean writeSkewCheck)
Makes internal copies of the entry for updates
|
Object |
getKey()
Retrieves the key to this entry
|
long |
getLifespan() |
long |
getMaxIdle() |
Object |
getValue()
Retrieves the value of this entry
|
EntryVersion |
getVersion() |
boolean |
isChanged() |
boolean |
isCreated() |
boolean |
isEvicted() |
protected boolean |
isFlagSet(ReadCommittedEntry.Flags flag)
Tests whether a flag is set.
|
boolean |
isLockPlaceholder() |
boolean |
isNull()
Tests whether the entry represents a null value, typically used for repeatable read.
|
boolean |
isRemoved() |
boolean |
isValid() |
void |
rollback()
Rolls back changes
|
protected void |
setChanged() |
void |
setCreated(boolean created) |
void |
setEvicted(boolean evicted) |
protected void |
setFlag(ReadCommittedEntry.Flags flag)
Utility method that sets the value of the given flag to true.
|
void |
setLifespan(long lifespan)
Sets the lifespan of the entry.
|
void |
setLockPlaceholder(boolean placeholder)
Marks an entry as a lock placeholder
|
void |
setMaxIdle(long maxIdle)
Sets the maximum idle time of the entry.
|
void |
setRemoved(boolean removed) |
void |
setValid(boolean valid) |
Object |
setValue(Object value)
Sets the value of the entry, returning the previous value
|
void |
setVersion(EntryVersion version)
Sets the version on this entry.
|
String |
toString() |
boolean |
undelete(boolean doUndelete)
If the entry is marked as removed and doUndelete==true then the "valid" flag is set to true and "removed"
flag is set to false.
|
protected void |
unsetFlag(ReadCommittedEntry.Flags flag)
Utility method that sets the value of the flag to false.
|
protected Object key
protected Object value
protected Object oldValue
protected byte flags
protected ReadCommittedEntry()
public ReadCommittedEntry(Object key, Object value, EntryVersion version, long lifespan)
protected final boolean isFlagSet(ReadCommittedEntry.Flags flag)
flag - flag to testprotected final void setFlag(ReadCommittedEntry.Flags flag)
flag - flag to setprotected final void unsetFlag(ReadCommittedEntry.Flags flag)
flag - flag to unsetpublic final long getLifespan()
getLifespan in interface CacheEntrypublic final long getMaxIdle()
getMaxIdle in interface CacheEntrypublic final void setMaxIdle(long maxIdle)
CacheEntrysetMaxIdle in interface CacheEntrymaxIdle - maxIdle to setpublic final void setLifespan(long lifespan)
CacheEntrysetLifespan in interface CacheEntrylifespan - lifespan to setpublic final Object getKey()
CacheEntrypublic final Object getValue()
CacheEntrypublic final Object setValue(Object value)
CacheEntrypublic boolean isNull()
CacheEntryisNull in interface CacheEntrypublic void copyForUpdate(DataContainer container, boolean writeSkewCheck)
MVCCEntrycopyForUpdate in interface MVCCEntrycontainer - data containerwriteSkewCheck - if true, write skews are tested for and exceptions are thrown if detected. Only applicable
to IsolationLevel.REPEATABLE_READ.public void setLockPlaceholder(boolean placeholder)
MVCCEntrysetLockPlaceholder in interface MVCCEntryplaceholder - if true, the entry is marked as a lock placeholder. If false, the entry is un-marked as a placeholder.public final void commit(DataContainer container, EntryVersion newVersion)
CacheEntrycommit in interface CacheEntrycontainer - data container to commit topublic final void rollback()
CacheEntryrollback in interface CacheEntrypublic final boolean isChanged()
isChanged in interface CacheEntryprotected final void setChanged()
public boolean isValid()
isValid in interface CacheEntrypublic final void setValid(boolean valid)
setValid in interface CacheEntrypublic boolean isLockPlaceholder()
isLockPlaceholder in interface CacheEntrypublic EntryVersion getVersion()
getVersion in interface Versionedpublic void setVersion(EntryVersion version)
VersionedsetVersion in interface Versionedversion - version to setpublic final boolean isCreated()
isCreated in interface CacheEntrypublic final void setCreated(boolean created)
setCreated in interface CacheEntrypublic boolean isRemoved()
isRemoved in interface CacheEntrypublic boolean isEvicted()
isEvicted in interface CacheEntrypublic final void setRemoved(boolean removed)
setRemoved in interface CacheEntrypublic void setEvicted(boolean evicted)
setEvicted in interface CacheEntrypublic boolean undelete(boolean doUndelete)
CacheEntryundelete in interface CacheEntryCopyright © 2012 JBoss by Red Hat. All Rights Reserved.