Class CacheState


  • public class CacheState
    extends Object
    • 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.