public interface MessageReader
Allows to customize the binary format of communication messages.
Modifier and Type | Method and Description |
---|---|
void |
afterInnerMessageRead(boolean finished)
Callback called after inner message is read.
|
boolean |
afterMessageRead(Class<? extends Message> msgCls)
Callback that must be invoked by a message implementation after message body finished decoding.
|
void |
beforeInnerMessageRead()
Callback called before inner message is read.
|
boolean |
beforeMessageRead()
Callback that must be invoked by a message implementation before message body started decoding.
|
void |
incrementState()
Increments read state.
|
boolean |
isLastRead()
Tells whether last invocation of any of
readXXX(...) |
org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion |
readAffinityTopologyVersion(String name)
Reads
AffinityTopologyVersion . |
BitSet |
readBitSet(String name)
Reads
BitSet . |
boolean |
readBoolean(String name)
Reads
boolean value. |
boolean[] |
readBooleanArray(String name)
Reads
boolean array. |
byte |
readByte(String name)
Reads
byte value. |
byte[] |
readByteArray(String name)
Reads
byte array. |
char |
readChar(String name)
Reads
char value. |
char[] |
readCharArray(String name)
Reads
char array. |
<C extends Collection<?>> |
readCollection(String name,
MessageCollectionItemType itemType)
Reads collection.
|
double |
readDouble(String name)
Reads
double value. |
double[] |
readDoubleArray(String name)
Reads
double array. |
float |
readFloat(String name)
Reads
float value. |
float[] |
readFloatArray(String name)
Reads
float array. |
IgniteUuid |
readIgniteUuid(String name)
Reads
IgniteUuid . |
int |
readInt(String name)
Reads
int value. |
int |
readInt(String name,
int dflt)
Reads
int value. |
int[] |
readIntArray(String name)
Reads
int array. |
long |
readLong(String name)
Reads
long value. |
long[] |
readLongArray(String name)
Reads
long array. |
<M extends Map<?,?>> |
readMap(String name,
MessageCollectionItemType keyType,
MessageCollectionItemType valType,
boolean linked)
Reads map.
|
<T extends Message> |
readMessage(String name)
Reads nested message.
|
<T> T[] |
readObjectArray(String name,
MessageCollectionItemType itemType,
Class<T> itemCls)
Reads array of objects.
|
short |
readShort(String name)
Reads
short value. |
short[] |
readShortArray(String name)
Reads
short array. |
String |
readString(String name)
Reads
String . |
UUID |
readUuid(String name)
Reads
UUID . |
void |
reset()
Resets this reader.
|
void |
setBuffer(ByteBuffer buf)
Sets but buffer to read from.
|
void |
setCurrentReadClass(Class<? extends Message> msgCls)
Sets type of message currently read.
|
int |
state()
Gets current read state.
|
void setBuffer(ByteBuffer buf)
buf
- Byte buffer.void setCurrentReadClass(Class<? extends Message> msgCls)
msgCls
- Message type.boolean beforeMessageRead()
True
if reading can proceed, false
otherwise.boolean afterMessageRead(Class<? extends Message> msgCls)
msgCls
- Message class finishing read stage.True
if reading can proceed, false
otherwise.byte readByte(String name)
byte
value.name
- Field name.byte
value.short readShort(String name)
short
value.name
- Field name.short
value.int readInt(String name)
int
value.name
- Field name.int
value.int readInt(String name, int dflt)
int
value.name
- Field name.dflt
- Default value if field not found.int
value.long readLong(String name)
long
value.name
- Field name.long
value.float readFloat(String name)
float
value.name
- Field name.float
value.double readDouble(String name)
double
value.name
- Field name.double
value.char readChar(String name)
char
value.name
- Field name.char
value.boolean readBoolean(String name)
boolean
value.name
- Field name.boolean
value.byte[] readByteArray(String name)
byte
array.name
- Field name.byte
array.short[] readShortArray(String name)
short
array.name
- Field name.short
array.int[] readIntArray(String name)
int
array.name
- Field name.int
array.long[] readLongArray(String name)
long
array.name
- Field name.long
array.float[] readFloatArray(String name)
float
array.name
- Field name.float
array.double[] readDoubleArray(String name)
double
array.name
- Field name.double
array.char[] readCharArray(String name)
char
array.name
- Field name.char
array.boolean[] readBooleanArray(String name)
boolean
array.name
- Field name.boolean
array.String readString(String name)
String
.name
- Field name.String
.BitSet readBitSet(String name)
BitSet
.name
- Field name.BitSet
.IgniteUuid readIgniteUuid(String name)
IgniteUuid
.name
- Field name.IgniteUuid
.org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion readAffinityTopologyVersion(String name)
AffinityTopologyVersion
.name
- Field name.AffinityTopologyVersion
.<T extends Message> T readMessage(String name)
name
- Field name.<T> T[] readObjectArray(String name, MessageCollectionItemType itemType, Class<T> itemCls)
name
- Field name.itemType
- Array component type.itemCls
- Array component class.<C extends Collection<?>> C readCollection(String name, MessageCollectionItemType itemType)
name
- Field name.itemType
- Collection item type.<M extends Map<?,?>> M readMap(String name, MessageCollectionItemType keyType, MessageCollectionItemType valType, boolean linked)
name
- Field name.keyType
- Map key type.valType
- Map value type.linked
- Whether LinkedHashMap
should be created.boolean isLastRead()
readXXX(...)
methods has fully written the value. False
is returned
if there were not enough remaining bytes in byte buffer.int state()
void incrementState()
void beforeInnerMessageRead()
void afterInnerMessageRead(boolean finished)
finished
- Whether message was fully read.void reset()
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024