jaydeepkumar1984 commented on code in PR #4126: URL: https://github.com/apache/cassandra/pull/4126#discussion_r2076508719
########## src/java/org/apache/cassandra/repair/autorepair/PrioritizedRepairPlan.java: ########## @@ -124,31 +123,20 @@ public static List<PrioritizedRepairPlan> build(Map<String, List<String>> keyspa List<String> keyspaceNames = new ArrayList<>(keyspacesAndTables.keySet()); orderFunc.accept(keyspaceNames); - for(String keyspaceName : keyspaceNames) + for (String keyspaceName : keyspaceNames) { - List<String> tableNames = keyspacesAndTables.get(keyspaceName); - orderFunc.accept(tableNames); - KeyspaceRepairPlan keyspaceRepairPlan = new KeyspaceRepairPlan(keyspaceName, new ArrayList<>(tableNames)); - keyspaceRepairPlans.add(keyspaceRepairPlan); + List<String> tableNames = keyspacesAndTables.get(keyspaceName); + orderFunc.accept(tableNames); + KeyspaceRepairPlan keyspaceRepairPlan = + new KeyspaceRepairPlan(keyspaceName, new ArrayList<>(tableNames), + AutoRepairUtils.calcTotalBytesToBeRepaired(repairType, primaryRangeOnly, keyspaceName, tableNames)); + keyspaceRepairPlans.add(keyspaceRepairPlan); } } return planList; } - /** - * Convenience method to build a repair plan for a single keyspace with tables. Primarily useful in testing. - * @param keyspaceName Keyspace to repair - * @param tableNames tables to repair for the given keyspace. - * @return Single repair plan. - */ - static List<PrioritizedRepairPlan> buildSingleKeyspacePlan(AutoRepairConfig.RepairType repairType, String keyspaceName, String ... tableNames) Review Comment: Removed this API because it was only being used in testing. Created a similar API under `unit/*` ########## src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java: ########## @@ -1186,4 +1196,197 @@ public static Collection<Range<Token>> split(Range<Token> tokenRange, int number } return ranges; } + Review Comment: Moved the following APIs from RepairTokenRangeSplitter.java to here -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org