public class BufferedMemoryManager extends AbstractMemoryManager
operationMap
Constructor and Description |
---|
BufferedMemoryManager(Path dataPath) |
Modifier and Type | Method and Description |
---|---|
OperationMemoryManager |
addOperation(int opID,
DataMessageType type)
Add an memory manager instance for the given operation
|
OperationMemoryManager |
addOperation(int opID,
DataMessageType type,
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 |
appendBulk(int opID,
java.lang.String key,
java.nio.ByteBuffer value)
Buffers the inputs before submitting to the store.
|
boolean |
close(int opID,
java.nio.ByteBuffer key)
flush and close the given key.
|
boolean |
close(int opID,
java.lang.String key)
Closing the key will make the BufferedMemoryManager to flush the current data into the store
and delete all the key information.
|
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
|
void |
deleteFromBMM(int opID,
java.lang.String key) |
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)
Makes sure all the data that is held in the BufferedMemoryManager is pushed into the
memory store
|
boolean |
flush(int opID,
java.lang.String key,
java.nio.ByteBuffer last)
Slight variation of flush for so that the last ByteBuffer does not need to be copied into the
map
|
boolean |
flushAll(int opID)
Flush all the keys that are stored for the given operation id.
|
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.util.Iterator<java.lang.Object> |
getIterator(int opID,
DataMessageType keyType,
DataMessageType valueType,
KryoSerializer deSerializer,
java.nio.ByteOrder order) |
java.util.Iterator<java.lang.Object> |
getIterator(int opID,
DataMessageType valueType,
KryoSerializer deSerializer,
java.nio.ByteOrder order) |
boolean |
init()
Initializes the Memory manager
|
boolean |
put(int opID,
byte[] key,
byte[] data) |
boolean |
put(int opID,
java.nio.ByteBuffer key,
java.nio.ByteBuffer value)
Stores the give key value pair in the memory manager
|
boolean |
put(int opID,
java.lang.String key,
java.nio.ByteBuffer value)
Stores the give key value pair in the memory manager
|
boolean |
putBulk(int opID,
java.lang.String key,
java.nio.ByteBuffer value)
Buffers the inputs before submitting it to the store.
|
boolean |
registerKey(int opID,
java.lang.String key) |
boolean |
registerKey(int opID,
java.lang.String key,
int step)
Register the key
|
boolean |
removeOperation(int opID)
Remove an operation from the memory manager.
|
getDeserialized, getDeserialized, getDeserialized
public BufferedMemoryManager(Path dataPath)
public boolean init()
MemoryManager
public 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)
MemoryManager
public boolean put(int opID, byte[] key, byte[] data)
public boolean put(int opID, java.lang.String key, java.nio.ByteBuffer value)
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 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 delete(int opID, java.nio.ByteBuffer key)
MemoryManager
public boolean delete(int opID, java.lang.String key)
MemoryManager
public void deleteFromBMM(int opID, java.lang.String key)
public OperationMemoryManager addOperation(int opID, DataMessageType type)
MemoryManager
public OperationMemoryManager addOperation(int opID, DataMessageType type, DataMessageType keyType)
public boolean removeOperation(int opID)
MemoryManager
opID
- operation id to be removedpublic boolean registerKey(int opID, java.lang.String key, int step)
key
- key value to be registeredstep
- the step size. The Memory manager will write to the store once this value
is reachedpublic boolean registerKey(int opID, java.lang.String key)
public boolean putBulk(int opID, java.lang.String key, java.nio.ByteBuffer value)
public boolean appendBulk(int opID, java.lang.String key, java.nio.ByteBuffer value)
public boolean flush(int opID, java.nio.ByteBuffer key)
MemoryManager
opID
- id of the operationkey
- key to be flushedpublic boolean flush(int opID, java.lang.String key)
public boolean flush(int opID)
public boolean flush(int opID, java.lang.String key, java.nio.ByteBuffer last)
key
- key to flushlast
- the last value that needs to be appended to the ByteBuffers that correspond to the
given keypublic boolean flushAll(int opID)
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)