test_class.file: src/server/src/test/java/io/cassandrareaper/service/RepairRunServiceTest.java
test_class.identifier: RepairRunServiceTest
test_case.body: @Test
    public void buildEndpointToRangeMapTest() {
      Map<List<String>, List<String>> rangeToEndpoint = Maps.newHashMap();
      rangeToEndpoint.put(Arrays.asList("1", "2"), Arrays.asList("node1", "node2", "node3"));
      rangeToEndpoint.put(Arrays.asList("2", "4"), Arrays.asList("node1", "node2", "node3"));
      rangeToEndpoint.put(Arrays.asList("4", "6"), Arrays.asList("node1"));
      rangeToEndpoint.put(Arrays.asList("6", "8"), Arrays.asList("node1", "node2"));
  
      Map<String, List<RingRange>> endpointToRangeMap = RepairRunService.buildEndpointToRangeMap(rangeToEndpoint);
  
      assertEquals(endpointToRangeMap.entrySet().size(), 3);
      assertEquals(endpointToRangeMap.get("node1").size(), 4);
      assertEquals(endpointToRangeMap.get("node2").size(), 3);
      assertEquals(endpointToRangeMap.get("node3").size(), 2);
    }
test_case.class_method_signature: RepairRunServiceTest.buildEndpointToRangeMapTest()
test_case.full_signature: @Test public void buildEndpointToRangeMapTest()
test_case.identifier: buildEndpointToRangeMapTest
test_case.invocations: newHashMap put asList asList put asList asList put asList asList put asList asList buildEndpointToRangeMap assertEquals size entrySet assertEquals size get assertEquals size get assertEquals size get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void buildEndpointToRangeMapTest()
focal_class.declarator: COMMA_SEPARATED_LIST_SPLITTER
        = Splitter.on(',').trimResults(CharMatcher.anyOf(" ()[]\"'")).omitEmptyStrings()
focal_class.modifier: public static final
focal_class.original_string: public static final Splitter COMMA_SEPARATED_LIST_SPLITTER
        = Splitter.on(',').trimResults(CharMatcher.anyOf(" ()[]\"'")).omitEmptyStrings();
focal_class.type: Splitter
focal_class.var_name: COMMA_SEPARATED_LIST_SPLITTER
focal_class.declarator: DEFAULT_SEGMENT_COUNT_PER_NODE = 16
focal_class.modifier: public static final
focal_class.original_string: public static final int DEFAULT_SEGMENT_COUNT_PER_NODE = 16;
focal_class.type: int
focal_class.var_name: DEFAULT_SEGMENT_COUNT_PER_NODE
focal_class.declarator: LOG = LoggerFactory.getLogger(RepairRunService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(RepairRunService.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: context
focal_class.modifier: private final
focal_class.original_string: private final AppContext context;
focal_class.type: AppContext
focal_class.var_name: context
focal_class.declarator: repairUnitService
focal_class.modifier: private final
focal_class.original_string: private final RepairUnitService repairUnitService;
focal_class.type: RepairUnitService
focal_class.var_name: repairUnitService
focal_class.file: src/server/src/main/java/io/cassandrareaper/service/RepairRunService.java
focal_class.identifier: RepairRunService
focal_class.class_method_signature: RepairRunService.RepairRunService(AppContext context)
focal_class.full_signature: private  RepairRunService(AppContext context)
focal_class.identifier: RepairRunService
focal_class.modifiers: private
focal_class.parameters: (AppContext context)
focal_class.signature:  RepairRunService(AppContext context)
focal_class.class_method_signature: RepairRunService.create(AppContext context)
focal_class.full_signature: public static RepairRunService create(AppContext context)
focal_class.identifier: create
focal_class.modifiers: public static
focal_class.parameters: (AppContext context)
focal_class.return: RepairRunService
focal_class.signature: RepairRunService create(AppContext context)
focal_class.class_method_signature: RepairRunService.registerRepairRun(
        Cluster cluster,
        RepairUnit repairUnit,
        Optional<String> cause,
        String owner,
        int segments,
        int segmentsPerNode,
        RepairParallelism repairParallelism,
        Double intensity)
focal_class.full_signature: public RepairRun registerRepairRun(
        Cluster cluster,
        RepairUnit repairUnit,
        Optional<String> cause,
        String owner,
        int segments,
        int segmentsPerNode,
        RepairParallelism repairParallelism,
        Double intensity)
focal_class.identifier: registerRepairRun
focal_class.modifiers: public
focal_class.parameters: (
        Cluster cluster,
        RepairUnit repairUnit,
        Optional<String> cause,
        String owner,
        int segments,
        int segmentsPerNode,
        RepairParallelism repairParallelism,
        Double intensity)
focal_class.return: RepairRun
focal_class.signature: RepairRun registerRepairRun(
        Cluster cluster,
        RepairUnit repairUnit,
        Optional<String> cause,
        String owner,
        int segments,
        int segmentsPerNode,
        RepairParallelism repairParallelism,
        Double intensity)
focal_class.class_method_signature: RepairRunService.generateSegments(
        Cluster targetCluster, int segmentCount, int segmentCountPerNode, RepairUnit repairUnit)
focal_class.full_signature: private List<Segment> generateSegments(
        Cluster targetCluster, int segmentCount, int segmentCountPerNode, RepairUnit repairUnit)
focal_class.identifier: generateSegments
focal_class.modifiers: private
focal_class.parameters: (
        Cluster targetCluster, int segmentCount, int segmentCountPerNode, RepairUnit repairUnit)
focal_class.return: List<Segment>
focal_class.signature: List<Segment> generateSegments(
        Cluster targetCluster, int segmentCount, int segmentCountPerNode, RepairUnit repairUnit)
focal_class.class_method_signature: RepairRunService.computeGlobalSegmentCount(
        int segmentCountPerNode,
        Map<String, List<RingRange>> endpointToRange)
focal_class.full_signature: static int computeGlobalSegmentCount(
        int segmentCountPerNode,
        Map<String, List<RingRange>> endpointToRange)
focal_class.identifier: computeGlobalSegmentCount
focal_class.modifiers: static
focal_class.parameters: (
        int segmentCountPerNode,
        Map<String, List<RingRange>> endpointToRange)
focal_class.return: int
focal_class.signature: int computeGlobalSegmentCount(
        int segmentCountPerNode,
        Map<String, List<RingRange>> endpointToRange)
focal_class.class_method_signature: RepairRunService.filterSegmentsByNodes(
        List<Segment> segments,
        RepairUnit repairUnit,
        Map<String, List<RingRange>> endpointToRange)
focal_class.full_signature: static List<Segment> filterSegmentsByNodes(
        List<Segment> segments,
        RepairUnit repairUnit,
        Map<String, List<RingRange>> endpointToRange)
focal_class.identifier: filterSegmentsByNodes
focal_class.modifiers: static
focal_class.parameters: (
        List<Segment> segments,
        RepairUnit repairUnit,
        Map<String, List<RingRange>> endpointToRange)
focal_class.return: List<Segment>
focal_class.signature: List<Segment> filterSegmentsByNodes(
        List<Segment> segments,
        RepairUnit repairUnit,
        Map<String, List<RingRange>> endpointToRange)
focal_class.class_method_signature: RepairRunService.buildEndpointToRangeMap(Map<List<String>, List<String>> rangeToEndpoint)
focal_class.full_signature: @VisibleForTesting static Map<String, List<RingRange>> buildEndpointToRangeMap(Map<List<String>, List<String>> rangeToEndpoint)
focal_class.identifier: buildEndpointToRangeMap
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: (Map<List<String>, List<String>> rangeToEndpoint)
focal_class.return: Map<String, List<RingRange>>
focal_class.signature: Map<String, List<RingRange>> buildEndpointToRangeMap(Map<List<String>, List<String>> rangeToEndpoint)
focal_class.class_method_signature: RepairRunService.buildReplicasToRangeMap(
        Map<List<String>, List<String>> rangeToEndpoint)
focal_class.full_signature: @VisibleForTesting static Map<List<String>, List<RingRange>> buildReplicasToRangeMap(
        Map<List<String>, List<String>> rangeToEndpoint)
focal_class.identifier: buildReplicasToRangeMap
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: (
        Map<List<String>, List<String>> rangeToEndpoint)
focal_class.return: Map<List<String>, List<RingRange>>
focal_class.signature: Map<List<String>, List<RingRange>> buildReplicasToRangeMap(
        Map<List<String>, List<String>> rangeToEndpoint)
focal_class.class_method_signature: RepairRunService.createRepairSegments(
        List<Segment> tokenSegments,
        RepairUnit repairUnit)
focal_class.full_signature: private static List<RepairSegment.Builder> createRepairSegments(
        List<Segment> tokenSegments,
        RepairUnit repairUnit)
focal_class.identifier: createRepairSegments
focal_class.modifiers: private static
focal_class.parameters: (
        List<Segment> tokenSegments,
        RepairUnit repairUnit)
focal_class.return: List<RepairSegment.Builder>
focal_class.signature: List<RepairSegment.Builder> createRepairSegments(
        List<Segment> tokenSegments,
        RepairUnit repairUnit)
focal_class.class_method_signature: RepairRunService.createRepairSegmentsForIncrementalRepair(
        Map<String, RingRange> nodes,
        RepairUnit repairUnit)
focal_class.full_signature: private static List<RepairSegment.Builder> createRepairSegmentsForIncrementalRepair(
        Map<String, RingRange> nodes,
        RepairUnit repairUnit)
focal_class.identifier: createRepairSegmentsForIncrementalRepair
focal_class.modifiers: private static
focal_class.parameters: (
        Map<String, RingRange> nodes,
        RepairUnit repairUnit)
focal_class.return: List<RepairSegment.Builder>
focal_class.signature: List<RepairSegment.Builder> createRepairSegmentsForIncrementalRepair(
        Map<String, RingRange> nodes,
        RepairUnit repairUnit)
focal_class.class_method_signature: RepairRunService.getClusterNodes(Cluster targetCluster, RepairUnit repairUnit)
focal_class.full_signature: private Map<String,RingRange> getClusterNodes(Cluster targetCluster, RepairUnit repairUnit)
focal_class.identifier: getClusterNodes
focal_class.modifiers: private
focal_class.parameters: (Cluster targetCluster, RepairUnit repairUnit)
focal_class.return: Map<String,RingRange>
focal_class.signature: Map<String,RingRange> getClusterNodes(Cluster targetCluster, RepairUnit repairUnit)
focal_class.class_method_signature: RepairRunService.getTableNamesBasedOnParam(
        Cluster cluster,
        String keyspace,
        Optional<String> tableNamesParam)
focal_class.full_signature: public Set<String> getTableNamesBasedOnParam(
        Cluster cluster,
        String keyspace,
        Optional<String> tableNamesParam)
focal_class.identifier: getTableNamesBasedOnParam
focal_class.modifiers: public
focal_class.parameters: (
        Cluster cluster,
        String keyspace,
        Optional<String> tableNamesParam)
focal_class.return: Set<String>
focal_class.signature: Set<String> getTableNamesBasedOnParam(
        Cluster cluster,
        String keyspace,
        Optional<String> tableNamesParam)
focal_class.class_method_signature: RepairRunService.getNodesToRepairBasedOnParam(
        Cluster cluster,
        Optional<String> nodesToRepairParam)
focal_class.full_signature: public Set<String> getNodesToRepairBasedOnParam(
        Cluster cluster,
        Optional<String> nodesToRepairParam)
focal_class.identifier: getNodesToRepairBasedOnParam
focal_class.modifiers: public
focal_class.parameters: (
        Cluster cluster,
        Optional<String> nodesToRepairParam)
focal_class.return: Set<String>
focal_class.signature: Set<String> getNodesToRepairBasedOnParam(
        Cluster cluster,
        Optional<String> nodesToRepairParam)
focal_class.class_method_signature: RepairRunService.getDatacentersToRepairBasedOnParam(Cluster cluster, Optional<String> datacenters)
focal_class.full_signature: public static Set<String> getDatacentersToRepairBasedOnParam(Cluster cluster, Optional<String> datacenters)
focal_class.identifier: getDatacentersToRepairBasedOnParam
focal_class.modifiers: public static
focal_class.parameters: (Cluster cluster, Optional<String> datacenters)
focal_class.return: Set<String>
focal_class.signature: Set<String> getDatacentersToRepairBasedOnParam(Cluster cluster, Optional<String> datacenters)
focal_method.body: @VisibleForTesting
    static Map<String, List<RingRange>> buildEndpointToRangeMap(Map<List<String>, List<String>> rangeToEndpoint) {
      Map<String, List<RingRange>> endpointToRange = Maps.newHashMap();
  
      for (Entry<List<String>, List<String>> entry : rangeToEndpoint.entrySet()) {
        RingRange range = new RingRange(entry.getKey().toArray(new String[entry.getKey().size()]));
        for (String endpoint : entry.getValue()) {
          List<RingRange> ranges = endpointToRange.getOrDefault(endpoint, Lists.newArrayList());
          ranges.add(range);
          endpointToRange.put(endpoint, ranges);
        }
      }
  
      return endpointToRange;
    }
focal_method.class_method_signature: RepairRunService.buildEndpointToRangeMap(Map<List<String>, List<String>> rangeToEndpoint)
focal_method.full_signature: @VisibleForTesting static Map<String, List<RingRange>> buildEndpointToRangeMap(Map<List<String>, List<String>> rangeToEndpoint)
focal_method.identifier: buildEndpointToRangeMap
focal_method.invocations: newHashMap entrySet toArray getKey size getKey getValue getOrDefault newArrayList add put
focal_method.modifiers: @VisibleForTesting static
focal_method.parameters: (Map<List<String>, List<String>> rangeToEndpoint)
focal_method.return: Map<String, List<RingRange>>
focal_method.signature: Map<String, List<RingRange>> buildEndpointToRangeMap(Map<List<String>, List<String>> rangeToEndpoint)