Class ShardSpecifier


  • public class ShardSpecifier
    extends Object
    Specifies a shard index and a total number of shards. Usually used in distributed environments, where data shards are split among multiple workers. Immutable.
    Author:
    Eyal Schneider
    • Constructor Detail

      • ShardSpecifier

        public ShardSpecifier​(int shardIndex,
                              int shardCount)
        Constructor
        Parameters:
        shardIndex - The index of the shard to process (must be between 0 and shardCount - 1)
        shardCount - The total number of shards to process
    • Method Detail

      • getShardIndex

        public int getShardIndex()
        Returns:
        The index of the shard to process (must be between 0 and getShardCount() - 1)
      • getShardCount

        public int getShardCount()
        Returns:
        The total number of shards to process
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object