|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.offheapstore.storage.LongStorageEngine<V>
public class LongStorageEngine<V>
A Long key storage engine.
This engine stores long keys as their primitive representations split between the hashCode and value fields.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.terracotta.offheapstore.storage.StorageEngine |
|---|
StorageEngine.Owner |
| Constructor Summary | |
|---|---|
LongStorageEngine(HalfStorageEngine<V> valueStorage)
|
|
| Method Summary | ||
|---|---|---|
void |
attachedMapping(long encoding,
int hash,
int metadata)
|
|
void |
bind(StorageEngine.Owner owner)
|
|
void |
clear()
Called to indicate that all keys and values are now free. |
|
static
|
createFactory(Factory<? extends HalfStorageEngine<V>> valueFactory)
|
|
void |
destroy()
|
|
boolean |
equalsKey(Object key,
long encoding)
Called to determine the equality of the given object against the given encoded form. |
|
boolean |
equalsValue(Object value,
long encoding)
Called to determine the equality of the given Java object value against the given encoded form. |
|
void |
freeMapping(long encoding,
int hash,
boolean removal)
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. |
|
void |
invalidateCache()
Invalidate any local key/value caches. |
|
Long |
readKey(long encoding,
int hashCode)
Converts the supplied encoded key into its correct object form. |
|
V |
readValue(long encoding)
Converts the supplied encoded value into its correct object form. |
|
boolean |
shrink()
|
|
String |
toString()
|
|
Long |
writeMapping(Long key,
V value,
int hash,
int metadata)
Converts the supplied key and value objects into their encoded form. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LongStorageEngine(HalfStorageEngine<V> valueStorage)
| Method Detail |
|---|
public static <V> Factory<LongStorageEngine<V>> createFactory(Factory<? extends HalfStorageEngine<V>> valueFactory)
public Long writeMapping(Long key,
V value,
int hash,
int metadata)
StorageEngine
writeMapping in interface StorageEngine<Long,V>key - a key objectvalue - a value objecthash - the key hashmetadata - the metadata bits
public void attachedMapping(long encoding,
int hash,
int metadata)
attachedMapping in interface StorageEngine<Long,V>
public void freeMapping(long encoding,
int hash,
boolean removal)
StorageEngineThis call can be used to free any associated resources tied to the lifecycle of the supplied encoded value.
freeMapping in interface StorageEngine<Long,V>encoding - encoded valuehash - hash of the freed mappingremoval - marks removal from a mappublic V readValue(long encoding)
StorageEngine
readValue in interface StorageEngine<Long,V>encoding - encoded value
public boolean equalsValue(Object value,
long encoding)
StorageEngine
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.
equalsValue in interface StorageEngine<Long,V>value - a value objectencoding - encoded value
true if the value and the encoding are equal
public Long readKey(long encoding,
int hashCode)
StorageEngine
readKey in interface StorageEngine<Long,V>encoding - encoded keyhashCode - hash-code of the decoded key
public boolean equalsKey(Object key,
long encoding)
StorageEngine
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.
equalsKey in interface StorageEngine<Long,V>key - a key objectencoding - encoded value
true if the key and the encoding are equalpublic void clear()
StorageEngine
clear in interface StorageEngine<Long,V>public long getAllocatedMemory()
StorageEngine
getAllocatedMemory in interface StorageEngine<Long,V>public long getOccupiedMemory()
StorageEngine
getOccupiedMemory in interface StorageEngine<Long,V>public long getVitalMemory()
StorageEngine
getVitalMemory in interface StorageEngine<Long,V>public long getDataSize()
StorageEngine
getDataSize in interface StorageEngine<Long,V>public String toString()
toString in class Objectpublic void invalidateCache()
StorageEngineThis 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 StorageEngine<Long,V>public void bind(StorageEngine.Owner owner)
bind in interface StorageEngine<Long,V>public void destroy()
destroy in interface StorageEngine<Long,V>public boolean shrink()
shrink in interface StorageEngine<Long,V>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||