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 Metadata |
metadata |
protected Object |
oldValue |
protected Object |
value |
Constructor and Description |
---|
ReadCommittedEntry(Object key,
Object value,
Metadata metadata) |
Modifier and Type | Method and Description |
---|---|
void |
commit(DataContainer container,
Metadata providedMetadata)
Commits changes
|
void |
copyForUpdate(DataContainer container)
Makes internal copies of the entry for updates
|
void |
copyStateFlagsFrom(StateChangingEntry other) |
Object |
getKey()
Retrieves the key to this entry
|
long |
getLifespan() |
long |
getMaxIdle() |
Metadata |
getMetadata()
Get metadata of this cache entry.
|
byte |
getStateFlags() |
Object |
getValue()
Retrieves the value of this entry
|
boolean |
isChanged() |
boolean |
isCreated() |
boolean |
isEvicted() |
protected boolean |
isFlagSet(ReadCommittedEntry.Flags flag)
Tests whether a flag is set.
|
boolean |
isLoaded() |
boolean |
isNull()
Tests whether the entry represents a null value, typically used for repeatable read.
|
boolean |
isRemoved() |
boolean |
isValid() |
void |
rollback()
Rolls back changes
|
void |
setChanged(boolean changed) |
void |
setCreated(boolean created) |
void |
setEvicted(boolean evicted) |
protected void |
setFlag(boolean enable,
ReadCommittedEntry.Flags flag) |
protected void |
setFlag(ReadCommittedEntry.Flags flag)
Utility method that sets the value of the given flag to true.
|
void |
setLoaded(boolean loaded) |
void |
setMetadata(Metadata metadata)
Set the metadata in the cache entry.
|
void |
setRemoved(boolean removed) |
void |
setSkipRemoteGet(boolean skipRemoteGet)
|
void |
setValid(boolean valid) |
Object |
setValue(Object value)
Sets the value of the entry, returning the previous value
|
boolean |
skipRemoteGet() |
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 Metadata metadata
public byte getStateFlags()
getStateFlags
in interface StateChangingEntry
public void copyStateFlagsFrom(StateChangingEntry other)
copyStateFlagsFrom
in interface StateChangingEntry
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 CacheEntry
public final long getMaxIdle()
getMaxIdle
in interface CacheEntry
public final Object getKey()
CacheEntry
public final Object getValue()
CacheEntry
public final Object setValue(Object value)
CacheEntry
public boolean isNull()
CacheEntry
isNull
in interface CacheEntry
public void copyForUpdate(DataContainer container)
MVCCEntry
copyForUpdate
in interface MVCCEntry
container
- data containerpublic final void commit(DataContainer container, Metadata providedMetadata)
CacheEntry
commit
in interface CacheEntry
container
- data container to commit topublic final void rollback()
CacheEntry
rollback
in interface CacheEntry
public final boolean isChanged()
isChanged
in interface CacheEntry
public final void setChanged(boolean changed)
setChanged
in interface CacheEntry
setChanged
in interface MVCCEntry
public void setSkipRemoteGet(boolean skipRemoteGet)
CacheEntry
setSkipRemoteGet
in interface CacheEntry
public boolean skipRemoteGet()
skipRemoteGet
in interface CacheEntry
true
if the value must not be fetch from a remote node.public boolean isValid()
isValid
in interface CacheEntry
public final void setValid(boolean valid)
setValid
in interface CacheEntry
public Metadata getMetadata()
MetadataAware
getMetadata
in interface MetadataAware
public void setMetadata(Metadata metadata)
MetadataAware
setMetadata
in interface MetadataAware
metadata
- to apply to the cache entrypublic final boolean isCreated()
isCreated
in interface CacheEntry
public final void setCreated(boolean created)
setCreated
in interface CacheEntry
public boolean isRemoved()
isRemoved
in interface CacheEntry
public boolean isEvicted()
isEvicted
in interface CacheEntry
public final void setRemoved(boolean removed)
setRemoved
in interface CacheEntry
public void setEvicted(boolean evicted)
setEvicted
in interface CacheEntry
public boolean isLoaded()
isLoaded
in interface CacheEntry
public void setLoaded(boolean loaded)
setLoaded
in interface CacheEntry
protected final void setFlag(boolean enable, ReadCommittedEntry.Flags flag)
public boolean undelete(boolean doUndelete)
CacheEntry
undelete
in interface CacheEntry
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.