public interface MessageWriter
Allows to customize the binary format of communication messages.
Modifier and Type | Method and Description |
---|---|
void |
afterInnerMessageWrite(boolean finished)
Callback called after inner message is written.
|
void |
beforeInnerMessageWrite()
Callback called before inner message is written.
|
void |
incrementState()
Increments state.
|
boolean |
isHeaderWritten() |
void |
onHeaderWritten()
Callback called when header of the message is written.
|
void |
reset()
Resets this writer.
|
void |
setBuffer(ByteBuffer buf)
Sets but buffer to write to.
|
void |
setCurrentWriteClass(Class<? extends Message> msgCls)
Sets type of message currently written.
|
int |
state()
Gets current message state.
|
boolean |
writeAffinityTopologyVersion(String name,
org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion val)
Writes
AffinityTopologyVersion . |
boolean |
writeBitSet(String name,
BitSet val)
Writes
BitSet . |
boolean |
writeBoolean(String name,
boolean val)
Writes
boolean value. |
boolean |
writeBooleanArray(String name,
boolean[] val)
Writes
boolean array. |
boolean |
writeByte(String name,
byte val)
Writes
byte value. |
boolean |
writeByteArray(String name,
byte[] val)
Writes
byte array. |
boolean |
writeByteArray(String name,
byte[] val,
long off,
int len)
Writes
byte array. |
boolean |
writeChar(String name,
char val)
Writes
char value. |
boolean |
writeCharArray(String name,
char[] val)
Writes
char array. |
<T> boolean |
writeCollection(String name,
Collection<T> col,
MessageCollectionItemType itemType)
Writes collection.
|
boolean |
writeDouble(String name,
double val)
Writes
double value. |
boolean |
writeDoubleArray(String name,
double[] val)
Writes
double array. |
boolean |
writeFloat(String name,
float val)
Writes
float value. |
boolean |
writeFloatArray(String name,
float[] val)
Writes
float array. |
boolean |
writeHeader(short type,
byte fieldCnt)
Writes message header.
|
boolean |
writeIgniteUuid(String name,
IgniteUuid val)
Writes
IgniteUuid . |
boolean |
writeInt(String name,
int val)
Writes
int value. |
boolean |
writeIntArray(String name,
int[] val)
Writes
int array. |
boolean |
writeLong(String name,
long val)
Writes
long value. |
boolean |
writeLongArray(String name,
long[] val)
Writes
long array. |
boolean |
writeLongArray(String name,
long[] val,
int len)
Writes
long array. |
<K,V> boolean |
writeMap(String name,
Map<K,V> map,
MessageCollectionItemType keyType,
MessageCollectionItemType valType)
Writes map.
|
boolean |
writeMessage(String name,
Message val)
Writes nested message.
|
<T> boolean |
writeObjectArray(String name,
T[] arr,
MessageCollectionItemType itemType)
Writes array of objects.
|
boolean |
writeShort(String name,
short val)
Writes
short value. |
boolean |
writeShortArray(String name,
short[] val)
Writes
short array. |
boolean |
writeString(String name,
String val)
Writes
String . |
boolean |
writeUuid(String name,
UUID val)
Writes
UUID . |
void setBuffer(ByteBuffer buf)
buf
- Byte buffer.void setCurrentWriteClass(Class<? extends Message> msgCls)
msgCls
- Message type.boolean writeHeader(short type, byte fieldCnt)
type
- Message type.fieldCnt
- Fields count.true
if successfully. Otherwise returns false
.boolean writeByte(String name, byte val)
byte
value.name
- Field name.val
- byte
value.boolean writeShort(String name, short val)
short
value.name
- Field name.val
- short
value.boolean writeInt(String name, int val)
int
value.name
- Field name.val
- int
value.boolean writeLong(String name, long val)
long
value.name
- Field name.val
- long
value.boolean writeFloat(String name, float val)
float
value.name
- Field name.val
- float
value.boolean writeDouble(String name, double val)
double
value.name
- Field name.val
- double
value.boolean writeChar(String name, char val)
char
value.name
- Field name.val
- char
value.boolean writeBoolean(String name, boolean val)
boolean
value.name
- Field name.val
- boolean
value.boolean writeByteArray(String name, byte[] val)
byte
array.name
- Field name.val
- byte
array.boolean writeByteArray(String name, byte[] val, long off, int len)
byte
array.name
- Field name.val
- byte
array.off
- Offset.len
- Length.boolean writeShortArray(String name, short[] val)
short
array.name
- Field name.val
- short
array.boolean writeIntArray(String name, int[] val)
int
array.name
- Field name.val
- int
array.boolean writeLongArray(String name, long[] val)
long
array.name
- Field name.val
- long
array.boolean writeLongArray(String name, long[] val, int len)
long
array.name
- Field name.val
- long
array.len
- Length.boolean writeFloatArray(String name, float[] val)
float
array.name
- Field name.val
- float
array.boolean writeDoubleArray(String name, double[] val)
double
array.name
- Field name.val
- double
array.boolean writeCharArray(String name, char[] val)
char
array.name
- Field name.val
- char
array.boolean writeBooleanArray(String name, boolean[] val)
boolean
array.name
- Field name.val
- boolean
array.boolean writeString(String name, String val)
String
.name
- Field name.val
- String
.boolean writeBitSet(String name, BitSet val)
BitSet
.name
- Field name.val
- BitSet
.boolean writeUuid(String name, UUID val)
UUID
.name
- Field name.val
- UUID
.boolean writeIgniteUuid(String name, IgniteUuid val)
IgniteUuid
.name
- Field name.val
- IgniteUuid
.boolean writeAffinityTopologyVersion(String name, org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion val)
AffinityTopologyVersion
.name
- Field name.val
- AffinityTopologyVersion
.boolean writeMessage(String name, Message val)
name
- Field name.val
- Message.<T> boolean writeObjectArray(String name, T[] arr, MessageCollectionItemType itemType)
T
- Type of the objects that array contains.name
- Field name.arr
- Array of objects.itemType
- Array component type.<T> boolean writeCollection(String name, Collection<T> col, MessageCollectionItemType itemType)
T
- Type of the objects that collection contains.name
- Field name.col
- Collection.itemType
- Collection item type.<K,V> boolean writeMap(String name, Map<K,V> map, MessageCollectionItemType keyType, MessageCollectionItemType valType)
K
- Initial key types of the map to write.V
- Initial value types of the map to write.name
- Field name.map
- Map.keyType
- Map key type.valType
- Map value type.boolean isHeaderWritten()
void onHeaderWritten()
int state()
void incrementState()
void beforeInnerMessageWrite()
void afterInnerMessageWrite(boolean finished)
finished
- Whether message was fully written.void reset()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023