public abstract class PortabilityBasedHalfStorageEngine<T> extends Object implements HalfStorageEngine<T>
| Constructor and Description |
|---|
PortabilityBasedHalfStorageEngine(Portability<? super T> portability) |
| Modifier and Type | Method and Description |
|---|---|
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbind, clear, destroy, getAllocatedMemory, getDataSize, getOccupiedMemory, getVitalMemory, shrinkpublic PortabilityBasedHalfStorageEngine(Portability<? super T> portability)
public Integer write(T object, int hash)
HalfStorageEnginewrite in interface HalfStorageEngine<T>object - a value objecthash - the keys hashpublic 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)
HalfStorageEngineread in interface HalfStorageEngine<T>encoding - encoded valuepublic 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 valuetrue 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>Copyright © 2015–2024. All rights reserved.