Interface MessageReader


  • public interface MessageReader
    Communication message reader.

    Allows to customize the binary format of communication messages.

    • Method Detail

      • setBuffer

        @Deprecated
        default void setBuffer​(ByteBuffer buf)
        Deprecated.
        Sets but buffer to read from.
        Parameters:
        buf - Byte buffer.
      • readByte

        byte readByte()
        Reads byte value.
        Returns:
        byte value.
      • readShort

        short readShort()
        Reads short value.
        Returns:
        short value.
      • readInt

        int readInt()
        Reads int value.
        Returns:
        int value.
      • readLong

        long readLong()
        Reads long value.
        Returns:
        long value.
      • readFloat

        float readFloat()
        Reads float value.
        Returns:
        float value.
      • readDouble

        double readDouble()
        Reads double value.
        Returns:
        double value.
      • readChar

        char readChar()
        Reads char value.
        Returns:
        char value.
      • readBoolean

        boolean readBoolean()
        Reads boolean value.
        Returns:
        boolean value.
      • readByteArray

        byte[] readByteArray()
        Reads byte array.
        Returns:
        byte array.
      • readShortArray

        short[] readShortArray()
        Reads short array.
        Returns:
        short array.
      • readIntArray

        int[] readIntArray()
        Reads int array.
        Returns:
        int array.
      • readLongArray

        long[] readLongArray()
        Reads long array.
        Returns:
        long array.
      • readFloatArray

        float[] readFloatArray()
        Reads float array.
        Returns:
        float array.
      • readDoubleArray

        double[] readDoubleArray()
        Reads double array.
        Returns:
        double array.
      • readCharArray

        char[] readCharArray()
        Reads char array.
        Returns:
        char array.
      • readBooleanArray

        boolean[] readBooleanArray()
        Reads boolean array.
        Returns:
        boolean array.
      • readAffinityTopologyVersion

        org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion readAffinityTopologyVersion()
        Reads AffinityTopologyVersion.
        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()
        Reads CacheObject.
        Returns:
        Cache object.
      • readKeyCacheObject

        org.apache.ignite.internal.processors.cache.KeyCacheObject readKeyCacheObject()
        Reads KeyCacheObject.
        Returns:
        Key cache object.
      • readGridLongList

        org.apache.ignite.internal.util.GridLongList readGridLongList()
        Reads GridLongList.
        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.
      • isLastRead

        boolean isLastRead()
        Tells whether last invocation of any of readXXX(...) methods has fully written the value. False is 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.