Class PrioritizedRepairPlan

java.lang.Object
org.apache.cassandra.repair.autorepair.PrioritizedRepairPlan

public class PrioritizedRepairPlan extends Object
Encapsulates a devised plan to repair tables, grouped by their keyspace and a given priority. This is used by AutoRepair to pass in an organized plan to IAutoRepairTokenRangeSplitter.getRepairAssignments(boolean, List) which can iterate over this plan in order to generate RepairAssignments.
  • Constructor Details

    • PrioritizedRepairPlan

      public PrioritizedRepairPlan(int priority, List<KeyspaceRepairPlan> keyspaceRepairPlans)
  • Method Details

    • getPriority

      public int getPriority()
    • getKeyspaceRepairPlans

      public List<KeyspaceRepairPlan> getKeyspaceRepairPlans()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • build

      public static List<PrioritizedRepairPlan> build(Map<String,List<String>> keyspacesToTableNames, AutoRepairConfig.RepairType repairType, Consumer<List<String>> orderFunc, boolean primaryRangeOnly)
      Builds a list of PrioritizedRepairPlans for the given keyspace and table map, ordered by priority from highest to lowest, where priority is derived from table schema's defined priority for the given repair type.

      If a keyspace has tables with differing priorities, those tables will be included in the PrioritizedRepairPlan for their given priority.

      Parameters:
      keyspacesToTableNames - A mapping keyspace to table names
      repairType - The repair type that is being executed
      orderFunc - A function to order keyspace and tables in the returned plan.
      Returns:
      Ordered list of plan's by table priorities.