org.apache.ignite.internal.pagemem.wal.record

## Class CacheState

- java.lang.Object
- - org.apache.ignite.internal.pagemem.wal.record.CacheState

    public class CacheState
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`CacheState(int partsCnt)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addPartitionState(int partId, long size, long cntr)`
`void` `addPartitionState(int partId, long size, long cntr, byte state)`
`long` `counterByPartition(int partId)` Gets partition counter by partition ID.
`int` `partitionByIndex(int idx)`
`long` `partitionCounterByIndex(int idx)`
`long` `partitionSizeByIndex(int idx)`
`int` `size()`
`long` `sizeByPartition(int partId)` Gets partition size by partition ID.
`byte` `stateByIndex(int idx)`
`String` `toString()`

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

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

### Constructor Detail

#### CacheState

    public CacheState(int partsCnt)

Parameters:
  `partsCnt` - Partitions count.

### Method Detail

#### addPartitionState

    public void addPartitionState(int partId,
                                  long size,
                                  long cntr)

Parameters:
  `partId` - Partition ID to add.
  `size` - Partition size.
  `cntr` - Partition counter.

#### addPartitionState

    public void addPartitionState(int partId,
                                  long size,
                                  long cntr,
                                  byte state)

Parameters:
  `partId` - Partition ID to add.
  `size` - Partition size.
  `cntr` - Partition counter.
  `state` - Partition state.

#### sizeByPartition

    public long sizeByPartition(int partId)

Gets partition size by partition ID.

Parameters:
  `partId` - Partition ID.
Returns:
  Partition size (will return `-1` if partition is not present in the record).

#### counterByPartition

    public long counterByPartition(int partId)

Gets partition counter by partition ID.

Parameters:
  `partId` - Partition ID.
Returns:
  Partition update counter (will return `-1` if partition is not present in the record).

#### partitionByIndex

    public int partitionByIndex(int idx)

Parameters:
  `idx` - Index to get.
Returns:
  Partition ID.

#### stateByIndex

    public byte stateByIndex(int idx)

Parameters:
  `idx` - Index to get.
Returns:
  State partition.

#### partitionSizeByIndex

    public long partitionSizeByIndex(int idx)

Parameters:
  `idx` - Index to get.
Returns:
  Partition size by index.

#### partitionCounterByIndex

    public long partitionCounterByIndex(int idx)

Parameters:
  `idx` - Index to get.
Returns:
  Partition size by index.

#### size

    public int size()

Returns:
  State size.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019