Class FixedSplitTokenRangeSplitter

java.lang.Object
org.apache.cassandra.repair.autorepair.FixedSplitTokenRangeSplitter
All Implemented Interfaces:
IAutoRepairTokenRangeSplitter

public class FixedSplitTokenRangeSplitter extends Object implements IAutoRepairTokenRangeSplitter
An implementation that splits token ranges into a fixed number of subranges.
  • Field Details

    • DEFAULT_NUMBER_OF_SUBRANGES

      public static final int DEFAULT_NUMBER_OF_SUBRANGES
      Selecting the default value is tricky. If we select a small number, individual repairs would be heavy. On the other hand, if we select a large number, too many repair sessions would be created.

      If vnodes are configured using num_tokens, attempts to evenly subdivide subranges by each range using the following formula:

      Math.max(1, numberOfSubranges / tokens.size())

      To maintain balance, 32 serves as a good default that accommodates both vnodes and non-vnodes effectively.

      See Also:
  • Constructor Details

  • Method Details

    • getRepairAssignments

      public Iterator<KeyspaceRepairAssignments> getRepairAssignments(boolean primaryRangeOnly, List<PrioritizedRepairPlan> repairPlans)
      Description copied from interface: IAutoRepairTokenRangeSplitter
      Split the token range you wish to repair into multiple assignments. The autorepair framework will repair the assignments from returned subrange iterator in the sequence it's provided.
      Specified by:
      getRepairAssignments in interface IAutoRepairTokenRangeSplitter
      Parameters:
      primaryRangeOnly - Whether to repair only this node's primary ranges or all of its ranges.
      repairPlans - A list of ordered prioritized repair plans to generate assignments for in order.
      Returns:
      iterator of repair assignments, with each element representing a grouping of repair assignments for a given keyspace. The iterator is traversed lazily KeyspaceRepairAssignments at a time with the intent to try to get the most up-to-date representation of your data (e.g. how much data exists and is unrepaired at a given time).
    • setParameter

      public void setParameter(String key, String value)
      Description copied from interface: IAutoRepairTokenRangeSplitter
      Update a configuration parameter. This is meant to be used by nodetool setautorepairconfig to update configuration dynamically.
      Specified by:
      setParameter in interface IAutoRepairTokenRangeSplitter
      Parameters:
      key - parameter to update
      value - The value to set to.
    • getParameters

      public Map<String,String> getParameters()
      Specified by:
      getParameters in interface IAutoRepairTokenRangeSplitter
      Returns:
      custom configuration. This is meant to be used by nodetool getautorepairconfig for retrieving the splitter configuration.