org.apache.ignite.internal.processors.cache.distributed.dht

## 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 and Description
`PartitionUpdateCountersMessage()`
`PartitionUpdateCountersMessage(int cacheId, int initSize)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `add(int part, long init, long updatesCnt)`
`int` `cacheId()`
`void` `clear()` Clears message.
`short` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`long` `initialCounter(int idx)`
`void` `initialCounter(int idx, long value)`
`Long` `nextCounter(int partId)` Calculate next counter for partition.
`void` `onAckReceived()` Method called when ack message received.
`int` `partition(int idx)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`int` `size()`
`String` `toString()`
`long` `updatesCount(int idx)`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### 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.

#### initialCounter

    public void initialCounter(int idx,
                               long value)

Parameters:
  `idx` - Item number.
  `value` - Initial partition counter.

#### 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`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020