Class RendezvousHashMapper.Builder

    • Method Detail

      • withPartitions

        public RendezvousHashMapper.Builder withPartitions​(int partitions)
        Sets the total amount of partitions that should be managed by the mapper (value must be a power of two).

        Value of this parameter must be above zero and must be a power of two. Default value is RendezvousHashMapper.DEFAULT_PARTITIONS.

        Parameters:
        partitions - Total amount of partitions that should be managed by the mapper (value must be a power of two).
        Returns:
        This instance.
      • withBackupNodes

        public RendezvousHashMapper.Builder withBackupNodes​(int backupNodes)
        Sets the amount of backup nodes that should be assigned to each partition by the mapper.

        If value of this parameter is zero then mapper will not manage backup nodes and Partition.backupNodes() will return an empty set. If value of this parameter is negative then mapper will use all available cluster nodes as backup nodes.

        Parameters:
        backupNodes - Amount of backup nodes that should be assigned to each partition by the mapper.
        Returns:
        This instance.
        See Also:
        Partition.backupNodes()