|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.cache.value.AbstractStatelessTimestampedValue<V>
org.terracotta.cache.value.AbstractTimestampedValue<byte[]>
org.terracotta.cache.serialization.SerializedEntry<T>
public class SerializedEntry<T>
Storage wrapper for serialized cache entries.
This wrapper handles the de-serialization of the serialized cache entries, and also the local caching (in a transient reference) of the de-serialized value.
| Field Summary |
|---|
| Fields inherited from class org.terracotta.cache.value.AbstractTimestampedValue |
|---|
lastAccessedTime |
| Fields inherited from class org.terracotta.cache.value.AbstractStatelessTimestampedValue |
|---|
UNUSED |
| Fields inherited from interface org.terracotta.cache.TimestampedValue |
|---|
NEVER_EXPIRE |
| Constructor Summary | |
|---|---|
SerializedEntry()
|
|
SerializedEntry(SerializedEntryParameters<T> params)
|
|
SerializedEntry(T deserialized,
byte[] serialized,
int createTime)
Constructs a wrapper around the given entry, and it's serialized state using a specific creation time. |
|
SerializedEntry(T deserialized,
byte[] serialized,
int createTime,
int lastAccessedTime)
Constructs a wrapper around the given entry, and it's serialized state using a specific creation and last accessed time. |
|
SerializedEntry(T deserialized,
byte[] serialized,
TimeSource timeSource)
Constructs a wrapper around the given entry, and it's serialized state. |
|
| Method Summary | |
|---|---|
void |
addedToLocalCache()
Discard the local copy of this entry's serialized state. |
boolean |
equals(Object obj)
Compare whether the value in this entry equals the value in another entry. |
int |
getCreateTime()
Retrieves the time when this value was created. |
T |
getDeserializedValue(SerializationStrategy<T> strategy)
Return a copy of this entry, potentially reusing a cached copy. |
T |
getDeserializedValue(SerializationStrategy<T> strategy,
ClassLoader classLoader)
Return a copy of this entry, potentially reusing a cached copy, using the specified classloader if required. |
T |
getDeserializedValueCopy(SerializationStrategy<T> strategy)
Return a new copy of this entry, newly deserialized from the serialized state. |
T |
getDeserializedValueCopy(SerializationStrategy<T> strategy,
ClassLoader classLoader)
Return a new copy of this entry, newly deserialized from the serialized state, using a specific classloader. |
byte[] |
getValue()
Get the actual value in the cache. |
void |
markTxnComplete()
|
void |
markTxnInProgress()
|
void |
nullByteArray()
|
void |
readExternal(ObjectInput in)
|
boolean |
shouldRecalculateSize()
|
String |
toString()
|
T |
unsafelyGetDeserializedValue(SerializationStrategy<T> strategy,
ClassLoader classLoader)
|
T |
unsafelyGetDeserializedValueCopy(SerializationStrategy<T> strategy,
ClassLoader classLoader)
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class org.terracotta.cache.value.AbstractTimestampedValue |
|---|
fastGetCapacityEvictionPolicyData, getCapacityEvictionPolicyData, getLastAccessedTime, setCapacityEvictionPolicyData, setLastAccessedTimeInternal |
| Methods inherited from class org.terracotta.cache.value.AbstractStatelessTimestampedValue |
|---|
expiresAt, expiresAt, hashCode, isExpired, markUsed, markUsed |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SerializedEntry()
public SerializedEntry(T deserialized,
byte[] serialized,
TimeSource timeSource)
deserialized - cache entryserialized - serialized formtimeSource - source for timestamps
public SerializedEntry(T deserialized,
byte[] serialized,
int createTime)
deserialized - cache entryserialized - serialized formcreateTime - creation timestamp
public SerializedEntry(T deserialized,
byte[] serialized,
int createTime,
int lastAccessedTime)
deserialized - cache entryserialized - serialized formcreateTime - creation timestamplastAccessedTime - last accessed timestamppublic SerializedEntry(SerializedEntryParameters<T> params)
| Method Detail |
|---|
public T getDeserializedValueCopy(SerializationStrategy<T> strategy)
throws IOException,
ClassNotFoundException
strategy - deserialization strategy
IOException - if de-serialization fails
ClassNotFoundException - if a necessary class definition is missing
public T getDeserializedValueCopy(SerializationStrategy<T> strategy,
ClassLoader classLoader)
throws IOException,
ClassNotFoundException
strategy - deserialization strategyclassLoader - loader to use during deserialization
IOException - if de-serialization fails
ClassNotFoundException - if a necessary class definition is missing
public T unsafelyGetDeserializedValueCopy(SerializationStrategy<T> strategy,
ClassLoader classLoader)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
public T getDeserializedValue(SerializationStrategy<T> strategy)
throws IOException,
ClassNotFoundException
strategy - deserialization strategy
IOException - if de-serialization fails
ClassNotFoundException - if a necessary class definition is missing
public T getDeserializedValue(SerializationStrategy<T> strategy,
ClassLoader classLoader)
throws IOException,
ClassNotFoundException
strategy - deserialization strategyclassLoader - loader to use during deserialization
IOException - if de-serialization fails
ClassNotFoundException - if a necessary class definition is missing
public T unsafelyGetDeserializedValue(SerializationStrategy<T> strategy,
ClassLoader classLoader)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundExceptionpublic void addedToLocalCache()
public int getCreateTime()
TimestampedValue
getCreateTime in interface TimestampedValue<byte[]>getCreateTime in class AbstractStatelessTimestampedValue<byte[]>public byte[] getValue()
TimestampedValue
getValue in interface TimestampedValue<byte[]>getValue in class AbstractStatelessTimestampedValue<byte[]>public String toString()
toString in class AbstractStatelessTimestampedValue<byte[]>
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOException
public void readExternal(ObjectInput in)
throws IOException
readExternal in interface ExternalizableIOExceptionpublic boolean equals(Object obj)
AbstractStatelessTimestampedValue
equals in class AbstractStatelessTimestampedValue<byte[]>public void markTxnInProgress()
public void markTxnComplete()
public void nullByteArray()
public boolean shouldRecalculateSize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||