Class FixedSplitTokenRangeSplitter
java.lang.Object
org.apache.cassandra.repair.autorepair.FixedSplitTokenRangeSplitter
- All Implemented Interfaces:
IAutoRepairTokenRangeSplitter
An implementation that splits token ranges into a fixed number of subranges.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSelecting the default value is tricky. -
Constructor Summary
ConstructorsConstructorDescriptionFixedSplitTokenRangeSplitter(AutoRepairConfig.RepairType repairType, Map<String, String> parameters) -
Method Summary
Modifier and TypeMethodDescriptiongetRepairAssignments(boolean primaryRangeOnly, List<PrioritizedRepairPlan> repairPlans) Split the token range you wish to repair into multiple assignments.voidsetParameter(String key, String value) Update a configuration parameter.
-
Field Details
-
DEFAULT_NUMBER_OF_SUBRANGES
public static final int DEFAULT_NUMBER_OF_SUBRANGESSelecting 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
-
FixedSplitTokenRangeSplitter
public FixedSplitTokenRangeSplitter(AutoRepairConfig.RepairType repairType, Map<String, String> parameters)
-
-
Method Details
-
getRepairAssignments
public Iterator<KeyspaceRepairAssignments> getRepairAssignments(boolean primaryRangeOnly, List<PrioritizedRepairPlan> repairPlans) Description copied from interface:IAutoRepairTokenRangeSplitterSplit 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:
getRepairAssignmentsin interfaceIAutoRepairTokenRangeSplitter- 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
KeyspaceRepairAssignmentsat 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
Description copied from interface:IAutoRepairTokenRangeSplitterUpdate a configuration parameter. This is meant to be used bynodetool setautorepairconfigto update configuration dynamically.- Specified by:
setParameterin interfaceIAutoRepairTokenRangeSplitter- Parameters:
key- parameter to updatevalue- The value to set to.
-
getParameters
- Specified by:
getParametersin interfaceIAutoRepairTokenRangeSplitter- Returns:
- custom configuration. This is meant to be used by
nodetool getautorepairconfigfor retrieving the splitter configuration.
-