Class ShardInfo


  • public class ShardInfo
    extends Object
    A container to express a shard index and count.
    • Method Detail

      • create

        public static ShardInfo create​(int index,
                                       int count)
      • getIndex

        public int getIndex()
        Return the shard index represented by this ShardInfo.
        Returns:
        the shard number (0-based)
      • getCount

        public int getCount()
        Return the shard count represented by this ShardInfo.
        Returns:
        the number of shards
      • asArray

        public int[] asArray()
        Return this ShardInfo object in array representation: [index, count]
        Returns:
        an array with 2 elements, index and count
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • format

        public String format()
        Return a string form of this ShardInfo using the following pattern: index,count
        Returns:
        a formatted string representing this object