public abstract class PackerStore
extends java.util.HashMap<java.lang.String,java.lang.Object>
When generating sending buffers, we need to first append the length of the
message as a header. In order to do that, packers might have to serialize
data first, so engine can retrieve the length via
DataPacker.determineLength(Object, PackerStore)
. Twister2 will pass
PackerStore
to this method, so packer can store the serialized data
temporarily to store and use later when writing to the buffer when
DataPacker.writeDataToBuffer(Object, PackerStore, int, int, int, ByteBuffer)
is called by engine.
Additionally, user can consider PackerStore
as an instance of Map
,
where arbitrary key,value pairs can be persisted. These values will be automatically cleared
by the engine when the 'current object' is fully serialized.
Constructor and Description |
---|
PackerStore() |
Modifier and Type | Method and Description |
---|---|
abstract byte[] |
retrieve()
Retrieve the stored serialized message
|
abstract void |
store(byte[] data)
Stores the serialized data temporarily
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values