|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.offheapstore.storage.PortabilityBasedHalfStorageEngine<T>
public abstract class PortabilityBasedHalfStorageEngine<T>
| Constructor Summary | |
|---|---|
PortabilityBasedHalfStorageEngine(Portability<? super T> portability)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object value,
int encoding)
Called to determine the equality of the given Java object value against the given encoded form. |
abstract void |
free(int encoding)
Called to indicate that the associated encoded value is no longer needed. |
void |
invalidateCache()
Invalidate any local key/value caches. |
T |
read(int encoding)
Converts the supplied encoded value into its correct object form. |
protected abstract ByteBuffer |
readBuffer(int encoding)
|
Integer |
write(T object,
int hash)
Converts the supplied value object into it's encoded form. |
protected abstract Integer |
writeBuffer(ByteBuffer buffer,
int hash)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.terracotta.offheapstore.storage.HalfStorageEngine |
|---|
bind, clear, destroy, getAllocatedMemory, getDataSize, getOccupiedMemory, getVitalMemory, shrink |
| Constructor Detail |
|---|
public PortabilityBasedHalfStorageEngine(Portability<? super T> portability)
| Method Detail |
|---|
public Integer write(T object,
int hash)
HalfStorageEngine
write in interface HalfStorageEngine<T>object - a value objecthash - the keys hash
public abstract void free(int encoding)
HalfStorageEngineThis call can be used to free any associated resources tied to the lifecycle of the supplied encoded value.
free in interface HalfStorageEngine<T>encoding - encoded valuepublic T read(int encoding)
HalfStorageEngine
read in interface HalfStorageEngine<T>encoding - encoded value
public boolean equals(Object value,
int encoding)
HalfStorageEngine
Simple implementations will probably perform a decode on the given encoded
form in order to do a regular Object.equals(Object) comparison.
This method is provided to allow implementations to optimize this
comparison if possible.
equals in interface HalfStorageEngine<T>value - a value objectencoding - encoded value
true if the value and the encoding are equalprotected abstract ByteBuffer readBuffer(int encoding)
protected abstract Integer writeBuffer(ByteBuffer buffer,
int hash)
public void invalidateCache()
HalfStorageEngineThis is called to indicate the termination of a map write "phase". Caching is permitted within a write operation (i.e. to cache around allocation failures during eviction processes).
invalidateCache in interface HalfStorageEngine<T>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||