Interface IAutoRepairTokenRangeSplitter
- All Known Implementing Classes:
FixedSplitTokenRangeSplitter,RepairTokenRangeSplitter
public interface IAutoRepairTokenRangeSplitter
Interface that defines how to generate
KeyspaceRepairAssignments.
The default is RepairTokenRangeSplitter which aims to provide sensible defaults for all repair types.
Custom implementations class should require a constructor accepting
(AutoRepairConfig.RepairType, Map) with the Map parameter accepting
custom configuration for your splitter. If such a constructor does not exist,
AutoRepairConfig.newAutoRepairTokenRangeSplitter(AutoRepairConfig.RepairType, ParameterizedClass)
will fall back on invoking a default zero argument constructor.-
Method Summary
Modifier and TypeMethodDescriptiongetRepairAssignments(boolean primaryRangeOnly, List<PrioritizedRepairPlan> repairPlans) Split the token range you wish to repair into multiple assignments.default voidsetParameter(String key, String value) Update a configuration parameter.
-
Method Details
-
getRepairAssignments
Iterator<KeyspaceRepairAssignments> getRepairAssignments(boolean primaryRangeOnly, List<PrioritizedRepairPlan> repairPlans) 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.- 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
Update a configuration parameter. This is meant to be used bynodetool setautorepairconfigto update configuration dynamically.- Parameters:
key- parameter to updatevalue- The value to set to.
-
getParameters
- Returns:
- custom configuration. This is meant to be used by
nodetool getautorepairconfigfor retrieving the splitter configuration.
-