Class PartitionUpdateCountersMessage
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.distributed.dht.PartitionUpdateCountersMessage
-
- All Implemented Interfaces:
Serializable,Message
public class PartitionUpdateCountersMessage extends Object implements Message
Partition update counters message.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message
DIRECT_TYPE_SIZE
-
-
Constructor Summary
Constructors Constructor Description PartitionUpdateCountersMessage()PartitionUpdateCountersMessage(int cacheId, int initSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int part, long init, long updatesCnt)intcacheId()voidclear()Clears message.shortdirectType()Gets message type.bytefieldsCount()Gets fields count.longinitialCounter(int idx)LongnextCounter(int partId)Calculate next counter for partition.voidonAckReceived()Method called when ack message received.intpartition(int idx)booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.intsize()StringtoString()longupdatesCount(int idx)booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.
-
-
-
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.
-
readFrom
public boolean readFrom(ByteBuffer buf, MessageReader reader)
Reads this message from provided byte buffer.
-
directType
public short directType()
Gets message type.- Specified by:
directTypein interfaceMessage- Returns:
- Message type.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Returns:
- Fields count.
-
onAckReceived
public void onAckReceived()
Method called when ack message received.- Specified by:
onAckReceivedin interfaceMessage
-
-