Interface MessageReader
-
public interface MessageReaderCommunication message reader.Allows to customize the binary format of communication messages.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidafterInnerMessageRead(boolean finished)Callback called after inner message is read.voidbeforeInnerMessageRead()Callback called before inner message is read.voidincrementState()Increments read state.booleanisLastRead()Tells whether last invocation of any ofreadXXX(...)methods has fully written the value.org.apache.ignite.internal.processors.affinity.AffinityTopologyVersionreadAffinityTopologyVersion()ReadsAffinityTopologyVersion.BitSetreadBitSet()ReadsBitSet.booleanreadBoolean()Readsbooleanvalue.boolean[]readBooleanArray()Readsbooleanarray.bytereadByte()Readsbytevalue.byte[]readByteArray()Readsbytearray.org.apache.ignite.internal.processors.cache.CacheObjectreadCacheObject()ReadsCacheObject.charreadChar()Readscharvalue.char[]readCharArray()Readschararray.<C extends Collection<?>>
CreadCollection(MessageCollectionItemType itemType)Reads any collection.doublereadDouble()Readsdoublevalue.double[]readDoubleArray()Readsdoublearray.floatreadFloat()Readsfloatvalue.float[]readFloatArray()Readsfloatarray.org.apache.ignite.internal.util.GridLongListreadGridLongList()ReadsGridLongList.IgniteUuidreadIgniteUuid()ReadsIgniteUuid.intreadInt()Readsintvalue.int[]readIntArray()Readsintarray.org.apache.ignite.internal.processors.cache.KeyCacheObjectreadKeyCacheObject()ReadsKeyCacheObject.longreadLong()Readslongvalue.long[]readLongArray()Readslongarray.<M extends Map<?,?>>
MreadMap(MessageCollectionItemType keyType, MessageCollectionItemType valType, boolean linked)Reads map.<T extends Message>
TreadMessage()Reads nested message.<T> T[]readObjectArray(MessageCollectionItemType itemType, Class<T> itemCls)Reads array of objects.<S extends Set<?>>
SreadSet(MessageCollectionItemType itemType)Reads any collection and provides it as a set.shortreadShort()Readsshortvalue.short[]readShortArray()Readsshortarray.StringreadString()ReadsString.UUIDreadUuid()ReadsUUID.voidreset()Resets this reader.default voidsetBuffer(ByteBuffer buf)Deprecated.intstate()Gets current read state.
-
-
-
Method Detail
-
setBuffer
@Deprecated default void setBuffer(ByteBuffer buf)
Deprecated.Sets but buffer to read from.- Parameters:
buf- Byte buffer.
-
readByte
byte readByte()
Readsbytevalue.- Returns:
bytevalue.
-
readShort
short readShort()
Readsshortvalue.- Returns:
shortvalue.
-
readInt
int readInt()
Readsintvalue.- Returns:
intvalue.
-
readLong
long readLong()
Readslongvalue.- Returns:
longvalue.
-
readFloat
float readFloat()
Readsfloatvalue.- Returns:
floatvalue.
-
readDouble
double readDouble()
Readsdoublevalue.- Returns:
doublevalue.
-
readChar
char readChar()
Readscharvalue.- Returns:
charvalue.
-
readBoolean
boolean readBoolean()
Readsbooleanvalue.- Returns:
booleanvalue.
-
readByteArray
byte[] readByteArray()
Readsbytearray.- Returns:
bytearray.
-
readShortArray
short[] readShortArray()
Readsshortarray.- Returns:
shortarray.
-
readIntArray
int[] readIntArray()
Readsintarray.- Returns:
intarray.
-
readLongArray
long[] readLongArray()
Readslongarray.- Returns:
longarray.
-
readFloatArray
float[] readFloatArray()
Readsfloatarray.- Returns:
floatarray.
-
readDoubleArray
double[] readDoubleArray()
Readsdoublearray.- Returns:
doublearray.
-
readCharArray
char[] readCharArray()
Readschararray.- Returns:
chararray.
-
readBooleanArray
boolean[] readBooleanArray()
Readsbooleanarray.- Returns:
booleanarray.
-
readIgniteUuid
IgniteUuid readIgniteUuid()
ReadsIgniteUuid.- Returns:
IgniteUuid.
-
readAffinityTopologyVersion
org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion readAffinityTopologyVersion()
ReadsAffinityTopologyVersion.- Returns:
AffinityTopologyVersion.
-
readMessage
<T extends Message> T readMessage()
Reads nested message.- Type Parameters:
T- Type of the message.- Returns:
- Message.
-
readCacheObject
org.apache.ignite.internal.processors.cache.CacheObject readCacheObject()
ReadsCacheObject.- Returns:
- Cache object.
-
readKeyCacheObject
org.apache.ignite.internal.processors.cache.KeyCacheObject readKeyCacheObject()
ReadsKeyCacheObject.- Returns:
- Key cache object.
-
readGridLongList
org.apache.ignite.internal.util.GridLongList readGridLongList()
ReadsGridLongList.- Returns:
- Grid long list.
-
readObjectArray
<T> T[] readObjectArray(MessageCollectionItemType itemType, Class<T> itemCls)
Reads array of objects.- Type Parameters:
T- Type of the read object.- Parameters:
itemType- Array component type.itemCls- Array component class.- Returns:
- Array of objects.
-
readCollection
<C extends Collection<?>> C readCollection(MessageCollectionItemType itemType)
Reads any collection.- Type Parameters:
C- Type of the read collection.- Parameters:
itemType- Collection item type.- Returns:
- Collection.
-
readSet
<S extends Set<?>> S readSet(MessageCollectionItemType itemType)
Reads any collection and provides it as a set.- Type Parameters:
S- Type of the read set.- Parameters:
itemType- Set item type.- Returns:
- Set.
-
readMap
<M extends Map<?,?>> M readMap(MessageCollectionItemType keyType, MessageCollectionItemType valType, boolean linked)
Reads map.- Type Parameters:
M- Type of the read map.- Parameters:
keyType- Map key type.valType- Map value type.linked- WhetherLinkedHashMapshould be created.- Returns:
- Map.
-
isLastRead
boolean isLastRead()
Tells whether last invocation of any ofreadXXX(...)methods has fully written the value.Falseis returned if there were not enough remaining bytes in byte buffer.- Returns:
- Whether las value was fully read.
-
state
int state()
Gets current read state.- Returns:
- Read state.
-
incrementState
void incrementState()
Increments read state.
-
beforeInnerMessageRead
void beforeInnerMessageRead()
Callback called before inner message is read.
-
afterInnerMessageRead
void afterInnerMessageRead(boolean finished)
Callback called after inner message is read.- Parameters:
finished- Whether message was fully read.
-
reset
void reset()
Resets this reader.
-
-