Class PortabilityBasedHalfStorageEngine<T>
java.lang.Object
org.terracotta.offheapstore.storage.PortabilityBasedHalfStorageEngine<T>
- All Implemented Interfaces:
HalfStorageEngine<T>
- Direct Known Subclasses:
OffHeapBufferHalfStorageEngine
public abstract class PortabilityBasedHalfStorageEngine<T>
extends Object
implements HalfStorageEngine<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCalled to determine the equality of the given Java object value against the given encoded form.abstract voidfree(int encoding) Called to indicate that the associated encoded value is no longer needed.voidInvalidate any local key/value caches.read(int encoding) Converts the supplied encoded value into its correct object form.protected abstract ByteBufferreadBuffer(int encoding) Converts the supplied value object into it's encoded form.protected abstract IntegerwriteBuffer(ByteBuffer buffer, int hash) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HalfStorageEngine
bind, clear, destroy, getAllocatedMemory, getDataSize, getOccupiedMemory, getVitalMemory, shrink
-
Field Details
-
portability
-
lastObject
-
-
Constructor Details
-
PortabilityBasedHalfStorageEngine
-
-
Method Details
-
write
Description copied from interface:HalfStorageEngineConverts the supplied value object into it's encoded form.- Specified by:
writein interfaceHalfStorageEngine<T>- Parameters:
object- a value objecthash- the keys hash- Returns:
- encoded value
-
free
public abstract void free(int encoding) Description copied from interface:HalfStorageEngineCalled to indicate that the associated encoded value is no longer needed.This call can be used to free any associated resources tied to the lifecycle of the supplied encoded value.
- Specified by:
freein interfaceHalfStorageEngine<T>- Parameters:
encoding- encoded value
-
read
Description copied from interface:HalfStorageEngineConverts the supplied encoded value into its correct object form.- Specified by:
readin interfaceHalfStorageEngine<T>- Parameters:
encoding- encoded value- Returns:
- a decoded value object
-
equals
Description copied from interface:HalfStorageEngineCalled to determine the equality of the given Java object value against the given encoded form.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.- Specified by:
equalsin interfaceHalfStorageEngine<T>- Parameters:
value- a value objectencoding- encoded value- Returns:
trueif the value and the encoding are equal
-
readBuffer
-
writeBuffer
-
invalidateCache
public void invalidateCache()Description copied from interface:HalfStorageEngineInvalidate any local key/value caches.This 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).
- Specified by:
invalidateCachein interfaceHalfStorageEngine<T>
-