K - key type handled by this engineV - value type handled by this enginepublic class OffHeapBufferStorageEngine<K,V> extends PortabilityBasedStorageEngine<K,V> implements OffHeapStorageArea.Owner
This storage engine implementation uses Portability instances to
convert key/value instances in to ByteBuffers. The content of these
ByteBuffers are then stored in slices of a single large data area.
StorageEngine.Owner| Modifier and Type | Field and Description |
|---|---|
protected StorageEngine.Owner |
owner |
protected OffHeapStorageArea |
storageArea |
keyPortability, valuePortability| Constructor and Description |
|---|
OffHeapBufferStorageEngine(PointerSize width,
PageSource source,
int initialPageSize,
int maximalPageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability) |
OffHeapBufferStorageEngine(PointerSize width,
PageSource source,
int initialPageSize,
int maximalPageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
boolean thief,
boolean victim) |
OffHeapBufferStorageEngine(PointerSize width,
PageSource source,
int initialPageSize,
int maximalPageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
boolean thief,
boolean victim,
float compressThreshold) |
OffHeapBufferStorageEngine(PointerSize width,
PageSource source,
int initialPageSize,
int maximalPageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
float compressThreshold) |
OffHeapBufferStorageEngine(PointerSize width,
PageSource source,
int pageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability)
Creates a storage engine using the given page source, and portabilities.
|
OffHeapBufferStorageEngine(PointerSize width,
PageSource source,
int pageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
boolean thief,
boolean victim) |
OffHeapBufferStorageEngine(PointerSize width,
PageSource source,
int pageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
boolean thief,
boolean victim,
float compressThreshold) |
OffHeapBufferStorageEngine(PointerSize width,
PageSource source,
int pageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
float compressThreshold) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(StorageEngine.Owner m) |
protected void |
clearInternal() |
static <K,V> Factory<OffHeapBufferStorageEngine<K,V>> |
createFactory(PointerSize width,
PageSource source,
int initialPageSize,
int maximalPageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
boolean thief,
boolean victim) |
static <K,V> Factory<OffHeapBufferStorageEngine<K,V>> |
createFactory(PointerSize width,
PageSource source,
int initialPageSize,
int maximalPageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
boolean thief,
boolean victim,
float compressThreshold) |
static <K,V> Factory<OffHeapBufferStorageEngine<K,V>> |
createFactory(PointerSize width,
PageSource source,
int pageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
boolean thief,
boolean victim) |
static <K,V> Factory<OffHeapBufferStorageEngine<K,V>> |
createFactory(PointerSize width,
PageSource source,
int pageSize,
Portability<? super K> keyPortability,
Portability<? super V> valuePortability,
boolean thief,
boolean victim,
float compressThreshold) |
void |
destroy() |
Collection<Long> |
evictAtAddress(long address,
boolean shrink) |
protected void |
free(long address) |
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.
|
protected WriteContext |
getKeyWriteContext(long address) |
long |
getOccupiedMemory()
Returns a measure of the amount of memory consumed by this storage engine.
|
protected WriteContext |
getValueWriteContext(long address) |
long |
getVitalMemory()
Returns a measure of the amount of vital memory allocated for this storage engine.
|
boolean |
isThief() |
boolean |
moved(long from,
long to) |
ByteBuffer |
readKeyBuffer(long address) |
int |
readKeyHash(long encoding) |
ByteBuffer |
readValueBuffer(long address) |
boolean |
shrink() |
int |
sizeOf(long address) |
String |
toString() |
Lock |
writeLock() |
protected Long |
writeMappingBuffers(ByteBuffer keyBuffer,
ByteBuffer valueBuffer,
int hash) |
protected Long |
writeMappingBuffersGathering(ByteBuffer[] keyBuffers,
ByteBuffer[] valueBuffers,
int hash) |
attachedMapping, clear, equalsBinaryKey, equalsKey, equalsValue, freeMapping, invalidateCache, readBinaryKey, readBinaryValue, readKey, readValue, writeBinaryMapping, writeBinaryMapping, writeMappingfireCleared, fireCopied, fireFreed, fireRecovered, fireWritten, hasListeners, hasRecoveryListeners, registerListenerprotected final OffHeapStorageArea storageArea
protected volatile StorageEngine.Owner owner
public OffHeapBufferStorageEngine(PointerSize width, PageSource source, int pageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability)
width - int or long based enginesource - allocator used for storage allocationpageSize - internal (constant) page sizekeyPortability - key type portabilityvaluePortability - value type portabilitypublic OffHeapBufferStorageEngine(PointerSize width, PageSource source, int pageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, float compressThreshold)
public OffHeapBufferStorageEngine(PointerSize width, PageSource source, int initialPageSize, int maximalPageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability)
public OffHeapBufferStorageEngine(PointerSize width, PageSource source, int initialPageSize, int maximalPageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, float compressThreshold)
public OffHeapBufferStorageEngine(PointerSize width, PageSource source, int pageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, boolean thief, boolean victim)
public OffHeapBufferStorageEngine(PointerSize width, PageSource source, int pageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, boolean thief, boolean victim, float compressThreshold)
public OffHeapBufferStorageEngine(PointerSize width, PageSource source, int initialPageSize, int maximalPageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, boolean thief, boolean victim)
public OffHeapBufferStorageEngine(PointerSize width, PageSource source, int initialPageSize, int maximalPageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, boolean thief, boolean victim, float compressThreshold)
public static <K,V> Factory<OffHeapBufferStorageEngine<K,V>> createFactory(PointerSize width, PageSource source, int pageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, boolean thief, boolean victim)
public static <K,V> Factory<OffHeapBufferStorageEngine<K,V>> createFactory(PointerSize width, PageSource source, int pageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, boolean thief, boolean victim, float compressThreshold)
public static <K,V> Factory<OffHeapBufferStorageEngine<K,V>> createFactory(PointerSize width, PageSource source, int initialPageSize, int maximalPageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, boolean thief, boolean victim)
public static <K,V> Factory<OffHeapBufferStorageEngine<K,V>> createFactory(PointerSize width, PageSource source, int initialPageSize, int maximalPageSize, Portability<? super K> keyPortability, Portability<? super V> valuePortability, boolean thief, boolean victim, float compressThreshold)
protected void clearInternal()
clearInternal in class PortabilityBasedStorageEngine<K,V>protected void free(long address)
free in class PortabilityBasedStorageEngine<K,V>public ByteBuffer readKeyBuffer(long address)
readKeyBuffer in class PortabilityBasedStorageEngine<K,V>protected WriteContext getKeyWriteContext(long address)
getKeyWriteContext in class PortabilityBasedStorageEngine<K,V>public ByteBuffer readValueBuffer(long address)
readValueBuffer in class PortabilityBasedStorageEngine<K,V>protected WriteContext getValueWriteContext(long address)
getValueWriteContext in class PortabilityBasedStorageEngine<K,V>protected Long writeMappingBuffers(ByteBuffer keyBuffer, ByteBuffer valueBuffer, int hash)
writeMappingBuffers in class PortabilityBasedStorageEngine<K,V>protected Long writeMappingBuffersGathering(ByteBuffer[] keyBuffers, ByteBuffer[] valueBuffers, int hash)
writeMappingBuffersGathering in class PortabilityBasedStorageEngine<K,V>public long getAllocatedMemory()
StorageEnginegetAllocatedMemory in interface StorageEngine<K,V>public long getOccupiedMemory()
StorageEnginegetOccupiedMemory in interface StorageEngine<K,V>public long getVitalMemory()
StorageEnginegetVitalMemory in interface StorageEngine<K,V>public long getDataSize()
StorageEnginegetDataSize in interface StorageEngine<K,V>public void destroy()
destroy in interface StorageEngine<K,V>public boolean shrink()
shrink in interface StorageEngine<K,V>public Collection<Long> evictAtAddress(long address, boolean shrink)
evictAtAddress in interface OffHeapStorageArea.Ownerpublic boolean isThief()
isThief in interface OffHeapStorageArea.Ownerpublic int readKeyHash(long encoding)
readKeyHash in interface BinaryStorageEnginepublic boolean moved(long from,
long to)
moved in interface OffHeapStorageArea.Ownerpublic int sizeOf(long address)
sizeOf in interface OffHeapStorageArea.Ownerpublic void bind(StorageEngine.Owner m)
bind in interface StorageEngine<K,V>public Lock writeLock()
writeLock in interface OffHeapStorageArea.OwnerCopyright © 2015–2024. All rights reserved.