Interface HalfStorageEngine<T>
-
- All Known Subinterfaces:
PersistentHalfStorageEngine<T>
- All Known Implementing Classes:
BooleanHalfStorageEngine,IntegerStorageEngine,OffHeapBufferHalfStorageEngine,PersistentIntegerStorageEngine,PortabilityBasedHalfStorageEngine
public interface HalfStorageEngine<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbind(StorageEngine.Owner owner, long mask)voidclear()Called to indicate that all keys and values are now free.voiddestroy()booleanequals(java.lang.Object object, int encoding)Called to determine the equality of the given Java object value against the given encoded form.voidfree(int encoding)Called to indicate that the associated encoded value is no longer needed.longgetAllocatedMemory()Returns a measure of the amount of memory allocated for this storage engine.longgetDataSize()Returns a measure of the total size of the keys and values stored in this storage engine.longgetOccupiedMemory()Returns a measure of the amount of memory consumed by this storage engine.longgetVitalMemory()Returns a measure of the amount of vital memory allocated for this storage engine.voidinvalidateCache()Invalidate any local key/value caches.Tread(int encoding)Converts the supplied encoded value into its correct object form.booleanshrink()java.lang.Integerwrite(T object, int hash)Converts the supplied value object into it's encoded form.
-
-
-
Method Detail
-
write
java.lang.Integer write(T object, int hash)
Converts the supplied value object into it's encoded form.- Parameters:
object- a value objecthash- the keys hash- Returns:
- encoded value
-
free
void free(int encoding)
Called 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.
- Parameters:
encoding- encoded value
-
read
T read(int encoding)
Converts the supplied encoded value into its correct object form.- Parameters:
encoding- encoded value- Returns:
- a decoded value object
-
equals
boolean equals(java.lang.Object object, int encoding)Called 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.- Parameters:
object- a value objectencoding- encoded value- Returns:
trueif the value and the encoding are equal
-
clear
void clear()
Called to indicate that all keys and values are now free.
-
getAllocatedMemory
long getAllocatedMemory()
Returns a measure of the amount of memory allocated for this storage engine.- Returns:
- memory allocated for this engine in bytes
-
getOccupiedMemory
long getOccupiedMemory()
Returns a measure of the amount of memory consumed by this storage engine.- Returns:
- memory occupied by this engine in bytes
-
getVitalMemory
long getVitalMemory()
Returns a measure of the amount of vital memory allocated for this storage engine.- Returns:
- vital memory allocated for this engine in bytes
-
getDataSize
long getDataSize()
Returns a measure of the total size of the keys and values stored in this storage engine.- Returns:
- size of the stored keys and values in bytes
-
invalidateCache
void invalidateCache()
Invalidate 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).
-
bind
void bind(StorageEngine.Owner owner, long mask)
-
destroy
void destroy()
-
shrink
boolean shrink()
-
-