public class LMDBMemoryManager extends AbstractMemoryManager
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.locks.Lock |
lock |
protected static java.lang.Boolean |
needsCommitReader |
protected static java.lang.Boolean |
needsCommitWriter |
operationMap
Constructor and Description |
---|
LMDBMemoryManager(Path dataPath) |
Modifier and Type | Method and Description |
---|---|
OperationMemoryManager |
addOperation(int opID,
DataMessageType messageType)
At this level the method does not return an OperationMemoryManager since the implementaion
does not handle OperationMemoryManager's
|
OperationMemoryManager |
addOperation(int opID,
DataMessageType messageType,
DataMessageType keyType) |
boolean |
append(int opID,
java.nio.ByteBuffer key,
java.nio.ByteBuffer value)
Appends the given byte buffer to the current value in the store.
|
boolean |
append(int opID,
java.lang.String key,
java.nio.ByteBuffer value) |
boolean |
close(int opID,
java.nio.ByteBuffer key)
flush and close the given key.
|
boolean |
close(int opID,
java.lang.String key) |
boolean |
containsKey(int opID,
java.nio.ByteBuffer key)
checks if the given key is in the memory manager
|
boolean |
containsKey(int opID,
java.lang.String key)
checks if the given key is in the memory manager
|
boolean |
delete(int opID,
java.nio.ByteBuffer key)
delete the given key from the store
|
boolean |
delete(int opID,
java.lang.String key)
delete the given key from the store
|
boolean |
flush(int opID) |
boolean |
flush(int opID,
java.nio.ByteBuffer key)
Flush all the data into the store.
|
boolean |
flush(int opID,
java.lang.String key) |
java.nio.ByteBuffer |
get(int opID,
java.nio.ByteBuffer key)
Get the corresponding value as ByteBuffer for the given key from the store
|
java.nio.ByteBuffer |
get(int opID,
java.lang.String key)
Get the corresponding value as ByteBuffer for the given key from the store
|
java.nio.ByteBuffer |
getAll(java.nio.ByteBuffer key) |
<any> |
getDb() |
<any> |
getEnv() |
java.util.Iterator<java.lang.Object> |
getIterator(int opID,
DataMessageType keyType,
DataMessageType valueType,
KryoSerializer deSerializer,
java.nio.ByteOrder order)
Returns an iterator that contains all the byte buffers for the given operation
|
java.util.Iterator<java.lang.Object> |
getIterator(int opID,
DataMessageType valueType,
KryoSerializer deSerializer,
java.nio.ByteOrder order)
Returns an iterator that contains all the byte buffers for the given operation
This method assumes that the keys are int's and that the do not need to be returned
|
Path |
getLmdbDataPath() |
boolean |
init()
Initializes the Memory manager
|
boolean |
put(int opID,
byte[] key,
byte[] value)
Insert key value pair into the
|
boolean |
put(int opID,
java.nio.ByteBuffer key,
java.nio.ByteBuffer value)
Insert key value pair into the
|
boolean |
put(int opID,
java.util.List<java.nio.ByteBuffer> keys,
java.util.List<java.nio.ByteBuffer> values)
Insert bulk key value pair into the
|
boolean |
put(int opID,
java.lang.String key,
java.nio.ByteBuffer value)
Stores the give key value pair in the memory manager
|
boolean |
removeOperation(int opID)
Remove an operation from the memory manager.
|
void |
setDb(<any> db) |
void |
setEnv(<any> env) |
void |
setLmdbDataPath(Path lmdbDataPath) |
getDeserialized, getDeserialized, getDeserialized
protected java.util.concurrent.locks.Lock lock
protected static java.lang.Boolean needsCommitWriter
protected static java.lang.Boolean needsCommitReader
public LMDBMemoryManager(Path dataPath)
public boolean init()
MemoryManager
public java.nio.ByteBuffer get(int opID, java.nio.ByteBuffer key)
MemoryManager
public java.nio.ByteBuffer get(int opID, java.lang.String key)
MemoryManager
public java.nio.ByteBuffer getAll(java.nio.ByteBuffer key)
public boolean containsKey(int opID, java.nio.ByteBuffer key)
MemoryManager
key
- key to be checkedpublic boolean containsKey(int opID, java.lang.String key)
MemoryManager
key
- key to be checkedpublic boolean append(int opID, java.nio.ByteBuffer key, java.nio.ByteBuffer value)
MemoryManager
opID
- id value of the operationkey
- key to append tovalue
- value to be appendedpublic boolean append(int opID, java.lang.String key, java.nio.ByteBuffer value)
public boolean put(int opID, java.nio.ByteBuffer key, java.nio.ByteBuffer value)
key
- the key, must be unver 511 bytes because of limits in LMDB implementaionvalue
- the value to be addedpublic boolean put(int opID, byte[] key, byte[] value)
key
- the key, must be unver 511 bytes because of limits in LMDB implementaionvalue
- the value to be addedpublic boolean put(int opID, java.util.List<java.nio.ByteBuffer> keys, java.util.List<java.nio.ByteBuffer> values)
keys
- the keys, must be unver 511 bytes because of limits in LMDB implementaionvalues
- the values to be addedpublic boolean put(int opID, java.lang.String key, java.nio.ByteBuffer value)
MemoryManager
public boolean delete(int opID, java.nio.ByteBuffer key)
MemoryManager
public boolean delete(int opID, java.lang.String key)
MemoryManager
public OperationMemoryManager addOperation(int opID, DataMessageType messageType)
public OperationMemoryManager addOperation(int opID, DataMessageType messageType, DataMessageType keyType)
public boolean removeOperation(int opID)
MemoryManager
opID
- operation id to be removedpublic boolean flush(int opID, java.nio.ByteBuffer key)
MemoryManager
opID
- id of the operationkey
- key to be flushedpublic boolean flush(int opID)
public boolean flush(int opID, java.lang.String key)
public boolean close(int opID, java.nio.ByteBuffer key)
MemoryManager
opID
- id of the operationkey
- key to be closedpublic boolean close(int opID, java.lang.String key)
public java.util.Iterator<java.lang.Object> getIterator(int opID, DataMessageType keyType, DataMessageType valueType, KryoSerializer deSerializer, java.nio.ByteOrder order)
public java.util.Iterator<java.lang.Object> getIterator(int opID, DataMessageType valueType, KryoSerializer deSerializer, java.nio.ByteOrder order)
public Path getLmdbDataPath()
public void setLmdbDataPath(Path lmdbDataPath)
public <any> getEnv()
public void setEnv(<any> env)
public <any> getDb()
public void setDb(<any> db)