Class PartitionUpdateCountersMessage

    • Constructor Detail

      • PartitionUpdateCountersMessage

        public PartitionUpdateCountersMessage()
      • PartitionUpdateCountersMessage

        public PartitionUpdateCountersMessage​(int cacheId,
                                              int initSize)
        Parameters:
        cacheId - Cache id.
        initSize - Initial size.
    • Method Detail

      • cacheId

        public int cacheId()
        Returns:
        Cache id.
      • size

        public int size()
        Returns:
        Size.
      • partition

        public int partition​(int idx)
        Parameters:
        idx - Item number.
        Returns:
        Partition number.
      • initialCounter

        public long initialCounter​(int idx)
        Parameters:
        idx - Item number.
        Returns:
        Partition number.
      • updatesCount

        public long updatesCount​(int idx)
        Parameters:
        idx - Item number.
        Returns:
        Update counter delta.
      • add

        public void add​(int part,
                        long init,
                        long updatesCnt)
        Parameters:
        part - Partition number.
        init - Init partition counter.
        updatesCnt - Update counter delta.
      • nextCounter

        public Long nextCounter​(int partId)
        Calculate next counter for partition.
        Parameters:
        partId - Partition id.
        Returns:
        Next counter for partition.
      • clear

        public void clear()
        Clears message.
      • writeTo

        public boolean writeTo​(ByteBuffer buf,
                               MessageWriter writer)
        Writes this message to provided byte buffer.
        Specified by:
        writeTo in interface Message
        Parameters:
        buf - Byte buffer.
        writer - Writer.
        Returns:
        Whether message was fully written.
      • readFrom

        public boolean readFrom​(ByteBuffer buf,
                                MessageReader reader)
        Reads this message from provided byte buffer.
        Specified by:
        readFrom in interface Message
        Parameters:
        buf - Byte buffer.
        reader - Reader.
        Returns:
        Whether message was fully read.
      • directType

        public short directType()
        Gets message type.
        Specified by:
        directType in interface Message
        Returns:
        Message type.
      • fieldsCount

        public byte fieldsCount()
        Gets fields count.
        Specified by:
        fieldsCount in interface Message
        Returns:
        Fields count.
      • onAckReceived

        public void onAckReceived()
        Method called when ack message received.
        Specified by:
        onAckReceived in interface Message