public class IntegerStorageEngine extends Object implements HalfStorageEngine<Integer>
Integer storage engine.
This engine stores the keys and values directly as their primitive representations, and therefore uses no additional data structure.
| Constructor and Description |
|---|
IntegerStorageEngine() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(StorageEngine.Owner owner,
long mask) |
void |
clear()
Called to indicate that all keys and values are now free.
|
static Factory<IntegerStorageEngine> |
createFactory() |
void |
destroy() |
boolean |
equals(Object key,
int address)
Called to determine the equality of the given Java object value against the
given encoded form.
|
void |
free(int address)
Called to indicate that the associated encoded value is no longer needed.
|
long |
getAllocatedMemory()
Returns a measure of the amount of memory allocated for this storage engine.
|
long |
getDataSize()
Returns a measure of the total size of the keys and values stored in this storage engine.
|
long |
getOccupiedMemory()
Returns a measure of the amount of memory consumed by this storage engine.
|
long |
getVitalMemory()
Returns a measure of the amount of vital memory allocated for this storage engine.
|
static IntegerStorageEngine |
instance() |
void |
invalidateCache()
Invalidate any local key/value caches.
|
Integer |
read(int address)
Converts the supplied encoded value into its correct object form.
|
boolean |
shrink() |
Integer |
write(Integer value,
int hash)
Converts the supplied value object into it's encoded form.
|
public static IntegerStorageEngine instance()
public static Factory<IntegerStorageEngine> createFactory()
public Integer read(int address)
HalfStorageEngineread in interface HalfStorageEngine<Integer>address - encoded valuepublic Integer write(Integer value, int hash)
HalfStorageEnginewrite in interface HalfStorageEngine<Integer>value - a value objecthash - the keys hashpublic void free(int address)
HalfStorageEngineThis call can be used to free any associated resources tied to the lifecycle of the supplied encoded value.
free in interface HalfStorageEngine<Integer>address - encoded valuepublic boolean equals(Object key, int address)
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<Integer>key - a value objectaddress - encoded valuetrue if the value and the encoding are equalpublic void clear()
HalfStorageEngineclear in interface HalfStorageEngine<Integer>public long getAllocatedMemory()
HalfStorageEnginegetAllocatedMemory in interface HalfStorageEngine<Integer>public long getOccupiedMemory()
HalfStorageEnginegetOccupiedMemory in interface HalfStorageEngine<Integer>public long getVitalMemory()
HalfStorageEnginegetVitalMemory in interface HalfStorageEngine<Integer>public long getDataSize()
HalfStorageEnginegetDataSize in interface HalfStorageEngine<Integer>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<Integer>public void bind(StorageEngine.Owner owner, long mask)
bind in interface HalfStorageEngine<Integer>public void destroy()
destroy in interface HalfStorageEngine<Integer>public boolean shrink()
shrink in interface HalfStorageEngine<Integer>Copyright © 2015–2024. All rights reserved.