test_class.declarator: LOG = LoggerFactory.getLogger(RepairRunnerTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(RepairRunnerTest.class);
test_class.type: Logger
test_class.var_name: LOG
test_class.declarator: TABLES = ImmutableSet.of("table1")
test_class.modifier: private static final
test_class.original_string: private static final Set<String> TABLES = ImmutableSet.of("table1");
test_class.type: Set<String>
test_class.var_name: TABLES
test_class.declarator: cluster = Cluster.builder()
              .withName("test_" + RandomStringUtils.randomAlphabetic(12))
              .withSeedHosts(ImmutableSet.of("127.0.0.1"))
              .withState(Cluster.State.ACTIVE)
              .build()
test_class.modifier: private final
test_class.original_string: private final Cluster cluster = Cluster.builder()
              .withName("test_" + RandomStringUtils.randomAlphabetic(12))
              .withSeedHosts(ImmutableSet.of("127.0.0.1"))
              .withState(Cluster.State.ACTIVE)
              .build();
test_class.type: Cluster
test_class.var_name: cluster
test_class.file: src/server/src/test/java/io/cassandrareaper/service/RepairRunnerTest.java
test_class.identifier: RepairRunnerTest
test_case.body: @Test
    public void getPossibleParallelRepairsTest() throws Exception {
      Map<List<String>, List<String>> map = RepairRunnerTest.threeNodeCluster();
      Map<String, String> endpointsThreeNodes = RepairRunnerTest.threeNodeClusterEndpoint();
      assertEquals(1, RepairRunner.getPossibleParallelRepairsCount(map, endpointsThreeNodes, DatacenterAvailability.ALL));
  
      map = RepairRunnerTest.sixNodeCluster();
      Map<String, String> endpointsSixNodes = RepairRunnerTest.sixNodeClusterEndpoint();
      assertEquals(2, RepairRunner.getPossibleParallelRepairsCount(map, endpointsSixNodes, DatacenterAvailability.ALL));
      assertEquals(1,
          RepairRunner.getPossibleParallelRepairsCount(map, endpointsSixNodes, DatacenterAvailability.SIDECAR));
    }
test_case.class_method_signature: RepairRunnerTest.getPossibleParallelRepairsTest()
test_case.full_signature: @Test public void getPossibleParallelRepairsTest()
test_case.identifier: getPossibleParallelRepairsTest
test_case.invocations: threeNodeCluster threeNodeClusterEndpoint assertEquals getPossibleParallelRepairsCount sixNodeCluster sixNodeClusterEndpoint assertEquals getPossibleParallelRepairsCount assertEquals getPossibleParallelRepairsCount
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getPossibleParallelRepairsTest()
focal_class.declarator: LOG = LoggerFactory.getLogger(RepairRunner.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(RepairRunner.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: clusterFacade
focal_class.modifier: private final
focal_class.original_string: private final ClusterFacade clusterFacade;
focal_class.type: ClusterFacade
focal_class.var_name: clusterFacade
focal_class.declarator: repairRunId
focal_class.modifier: private final
focal_class.original_string: private final UUID repairRunId;
focal_class.type: UUID
focal_class.var_name: repairRunId
focal_class.declarator: clusterName
focal_class.modifier: private final
focal_class.original_string: private final String clusterName;
focal_class.type: String
focal_class.var_name: clusterName
focal_class.declarator: currentlyRunningSegments
focal_class.modifier: private final
focal_class.original_string: private final AtomicReferenceArray<UUID> currentlyRunningSegments;
focal_class.type: AtomicReferenceArray<UUID>
focal_class.var_name: currentlyRunningSegments
focal_class.declarator: parallelRanges
focal_class.modifier: private final
focal_class.original_string: private final List<RingRange> parallelRanges;
focal_class.type: List<RingRange>
focal_class.var_name: parallelRanges
focal_class.declarator: metricNameForMillisSinceLastRepairPerKeyspace
focal_class.modifier: private final
focal_class.original_string: private final String metricNameForMillisSinceLastRepairPerKeyspace;
focal_class.type: String
focal_class.var_name: metricNameForMillisSinceLastRepairPerKeyspace
focal_class.declarator: metricNameForMillisSinceLastRepair
focal_class.modifier: private final
focal_class.original_string: private final String metricNameForMillisSinceLastRepair;
focal_class.type: String
focal_class.var_name: metricNameForMillisSinceLastRepair
focal_class.declarator: cluster
focal_class.modifier: private final
focal_class.original_string: private final Cluster cluster;
focal_class.type: Cluster
focal_class.var_name: cluster
focal_class.declarator: repairProgress
focal_class.modifier: private
focal_class.original_string: private float repairProgress;
focal_class.type: float
focal_class.var_name: repairProgress
focal_class.declarator: segmentsDone
focal_class.modifier: private
focal_class.original_string: private float segmentsDone;
focal_class.type: float
focal_class.var_name: segmentsDone
focal_class.declarator: segmentsTotal
focal_class.modifier: private
focal_class.original_string: private float segmentsTotal;
focal_class.type: float
focal_class.var_name: segmentsTotal
focal_class.declarator: localEndpointRanges
focal_class.modifier: private final
focal_class.original_string: private final List<RingRange> localEndpointRanges;
focal_class.type: List<RingRange>
focal_class.var_name: localEndpointRanges
focal_class.file: src/server/src/main/java/io/cassandrareaper/service/RepairRunner.java
focal_class.identifier: RepairRunner
focal_class.interfaces: implements Runnable
focal_class.class_method_signature: RepairRunner.RepairRunner(
        AppContext context,
        UUID repairRunId,
        ClusterFacade clusterFacade)
focal_class.full_signature: private  RepairRunner(
        AppContext context,
        UUID repairRunId,
        ClusterFacade clusterFacade)
focal_class.identifier: RepairRunner
focal_class.modifiers: private
focal_class.parameters: (
        AppContext context,
        UUID repairRunId,
        ClusterFacade clusterFacade)
focal_class.signature:  RepairRunner(
        AppContext context,
        UUID repairRunId,
        ClusterFacade clusterFacade)
focal_class.class_method_signature: RepairRunner.create(
        AppContext context,
        UUID repairRunId,
        ClusterFacade clusterFacade)
focal_class.full_signature: public static RepairRunner create(
        AppContext context,
        UUID repairRunId,
        ClusterFacade clusterFacade)
focal_class.identifier: create
focal_class.modifiers: public static
focal_class.parameters: (
        AppContext context,
        UUID repairRunId,
        ClusterFacade clusterFacade)
focal_class.return: RepairRunner
focal_class.signature: RepairRunner create(
        AppContext context,
        UUID repairRunId,
        ClusterFacade clusterFacade)
focal_class.class_method_signature: RepairRunner.registerMetric(String metricName, Gauge<?> gauge)
focal_class.full_signature: private void registerMetric(String metricName, Gauge<?> gauge)
focal_class.identifier: registerMetric
focal_class.modifiers: private
focal_class.parameters: (String metricName, Gauge<?> gauge)
focal_class.return: void
focal_class.signature: void registerMetric(String metricName, Gauge<?> gauge)
focal_class.class_method_signature: RepairRunner.getRepairRunId()
focal_class.full_signature:  UUID getRepairRunId()
focal_class.identifier: getRepairRunId
focal_class.parameters: ()
focal_class.return: UUID
focal_class.signature: UUID getRepairRunId()
focal_class.class_method_signature: RepairRunner.getPossibleParallelRepairsCount(
        Map<List<String>, List<String>> ranges,
        Map<String, String> hostsInRing,
        DatacenterAvailability datacenterAvailability)
focal_class.full_signature: static int getPossibleParallelRepairsCount(
        Map<List<String>, List<String>> ranges,
        Map<String, String> hostsInRing,
        DatacenterAvailability datacenterAvailability)
focal_class.identifier: getPossibleParallelRepairsCount
focal_class.modifiers: static
focal_class.parameters: (
        Map<List<String>, List<String>> ranges,
        Map<String, String> hostsInRing,
        DatacenterAvailability datacenterAvailability)
focal_class.return: int
focal_class.signature: int getPossibleParallelRepairsCount(
        Map<List<String>, List<String>> ranges,
        Map<String, String> hostsInRing,
        DatacenterAvailability datacenterAvailability)
focal_class.class_method_signature: RepairRunner.getParallelRanges(int parallelRepairs, List<RingRange> segments)
focal_class.full_signature: static List<RingRange> getParallelRanges(int parallelRepairs, List<RingRange> segments)
focal_class.identifier: getParallelRanges
focal_class.modifiers: static
focal_class.parameters: (int parallelRepairs, List<RingRange> segments)
focal_class.return: List<RingRange>
focal_class.signature: List<RingRange> getParallelRanges(int parallelRepairs, List<RingRange> segments)
focal_class.class_method_signature: RepairRunner.run()
focal_class.full_signature: @Override public void run()
focal_class.identifier: run
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void run()
focal_class.class_method_signature: RepairRunner.start()
focal_class.full_signature: private void start()
focal_class.identifier: start
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void start()
focal_class.class_method_signature: RepairRunner.updateClusterNodeList()
focal_class.full_signature: private void updateClusterNodeList()
focal_class.identifier: updateClusterNodeList
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void updateClusterNodeList()
focal_class.class_method_signature: RepairRunner.endRepairRun()
focal_class.full_signature: private void endRepairRun()
focal_class.identifier: endRepairRun
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void endRepairRun()
focal_class.class_method_signature: RepairRunner.startNextSegment()
focal_class.full_signature: private void startNextSegment()
focal_class.identifier: startNextSegment
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void startNextSegment()
focal_class.class_method_signature: RepairRunner.repairSegment(final int rangeIndex, final UUID segmentId, Segment segment)
focal_class.full_signature: private boolean repairSegment(final int rangeIndex, final UUID segmentId, Segment segment)
focal_class.identifier: repairSegment
focal_class.modifiers: private
focal_class.parameters: (final int rangeIndex, final UUID segmentId, Segment segment)
focal_class.return: boolean
focal_class.signature: boolean repairSegment(final int rangeIndex, final UUID segmentId, Segment segment)
focal_class.class_method_signature: RepairRunner.filterPotentialCoordinatorsByDatacenters(
        Collection<String> datacenters,
        List<String> potentialCoordinators)
focal_class.full_signature: private List<String> filterPotentialCoordinatorsByDatacenters(
        Collection<String> datacenters,
        List<String> potentialCoordinators)
focal_class.identifier: filterPotentialCoordinatorsByDatacenters
focal_class.modifiers: private
focal_class.parameters: (
        Collection<String> datacenters,
        List<String> potentialCoordinators)
focal_class.return: List<String>
focal_class.signature: List<String> filterPotentialCoordinatorsByDatacenters(
        Collection<String> datacenters,
        List<String> potentialCoordinators)
focal_class.class_method_signature: RepairRunner.getNodeDatacenterPair(String node)
focal_class.full_signature: private Pair<String, String> getNodeDatacenterPair(String node)
focal_class.identifier: getNodeDatacenterPair
focal_class.modifiers: private
focal_class.parameters: (String node)
focal_class.return: Pair<String, String>
focal_class.signature: Pair<String, String> getNodeDatacenterPair(String node)
focal_class.class_method_signature: RepairRunner.handleResult(UUID segmentId)
focal_class.full_signature: private void handleResult(UUID segmentId)
focal_class.identifier: handleResult
focal_class.modifiers: private
focal_class.parameters: (UUID segmentId)
focal_class.return: void
focal_class.signature: void handleResult(UUID segmentId)
focal_class.class_method_signature: RepairRunner.updateLastEvent(String newEvent)
focal_class.full_signature:  void updateLastEvent(String newEvent)
focal_class.identifier: updateLastEvent
focal_class.parameters: (String newEvent)
focal_class.return: void
focal_class.signature: void updateLastEvent(String newEvent)
focal_class.class_method_signature: RepairRunner.killAndCleanupRunner()
focal_class.full_signature:  void killAndCleanupRunner()
focal_class.identifier: killAndCleanupRunner
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void killAndCleanupRunner()
focal_class.class_method_signature: RepairRunner.metricName(String metric, String clusterName, String keyspaceName, UUID repairRunId)
focal_class.full_signature: private String metricName(String metric, String clusterName, String keyspaceName, UUID repairRunId)
focal_class.identifier: metricName
focal_class.modifiers: private
focal_class.parameters: (String metric, String clusterName, String keyspaceName, UUID repairRunId)
focal_class.return: String
focal_class.signature: String metricName(String metric, String clusterName, String keyspaceName, UUID repairRunId)
focal_class.class_method_signature: RepairRunner.metricName(String metric, String clusterName, UUID repairRunId)
focal_class.full_signature: private String metricName(String metric, String clusterName, UUID repairRunId)
focal_class.identifier: metricName
focal_class.modifiers: private
focal_class.parameters: (String metric, String clusterName, UUID repairRunId)
focal_class.return: String
focal_class.signature: String metricName(String metric, String clusterName, UUID repairRunId)
focal_class.class_method_signature: RepairRunner.fixMissingRepairRunTables(RepairRun repairRun, RepairUnit repairUnit)
focal_class.full_signature: private RepairRun fixMissingRepairRunTables(RepairRun repairRun, RepairUnit repairUnit)
focal_class.identifier: fixMissingRepairRunTables
focal_class.modifiers: private
focal_class.parameters: (RepairRun repairRun, RepairUnit repairUnit)
focal_class.return: RepairRun
focal_class.signature: RepairRun fixMissingRepairRunTables(RepairRun repairRun, RepairUnit repairUnit)
focal_method.body: static int getPossibleParallelRepairsCount(
        Map<List<String>, List<String>> ranges,
        Map<String, String> hostsInRing,
        DatacenterAvailability datacenterAvailability) throws ReaperException {
  
      if (ranges.isEmpty()) {
        String msg = "Repairing 0-sized cluster.";
        LOG.error(msg);
        throw new ReaperException(msg);
      }
  
      if (DatacenterAvailability.SIDECAR == datacenterAvailability) {
        // only 1 segment can be repaired by each instance at once in sidecar mode
        return 1;
      }
  
      LOG.debug(
          "Possible parallel repairs : {}",
          Math.min(
              ranges.size() / ranges.values().iterator().next().size(),
              Math.max(1, hostsInRing.keySet().size() / ranges.values().iterator().next().size())));
      return Math.min(
          ranges.size() / ranges.values().iterator().next().size(),
          Math.max(1, hostsInRing.keySet().size() / ranges.values().iterator().next().size()));
    }
focal_method.class_method_signature: RepairRunner.getPossibleParallelRepairsCount(
        Map<List<String>, List<String>> ranges,
        Map<String, String> hostsInRing,
        DatacenterAvailability datacenterAvailability)
focal_method.full_signature: static int getPossibleParallelRepairsCount(
        Map<List<String>, List<String>> ranges,
        Map<String, String> hostsInRing,
        DatacenterAvailability datacenterAvailability)
focal_method.identifier: getPossibleParallelRepairsCount
focal_method.invocations: isEmpty error debug min size size next iterator values max size keySet size next iterator values min size size next iterator values max size keySet size next iterator values
focal_method.modifiers: static
focal_method.parameters: (
        Map<List<String>, List<String>> ranges,
        Map<String, String> hostsInRing,
        DatacenterAvailability datacenterAvailability)
focal_method.return: int
focal_method.signature: int getPossibleParallelRepairsCount(
        Map<List<String>, List<String>> ranges,
        Map<String, String> hostsInRing,
        DatacenterAvailability datacenterAvailability)