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.file: src/server/src/test/java/io/cassandrareaper/service/RepairManagerTest.java
test_class.identifier: RepairManagerTest
test_case.body: @Test
    public void updateRepairRunIntensityTest() throws ReaperException, InterruptedException {
      final String clusterName = "reaper";
  
      AppContext context = new AppContext();
      context.config = new ReaperApplicationConfiguration();
      context.storage = mock(IStorage.class);
  
      context.storage
          .addCluster(Cluster.builder().withName(clusterName).withSeedHosts(ImmutableSet.of("127.0.0.1")).build());
  
      context.repairManager = RepairManager.create(
          context,
          Executors.newScheduledThreadPool(1),
          500,
          TimeUnit.MILLISECONDS,
          1,
          TimeUnit.MILLISECONDS);
  
      final String ksName = "reaper";
      final Set<String> cfNames = Sets.newHashSet("reaper");
      final boolean incrementalRepair = false;
      final Set<String> nodes = Sets.newHashSet("127.0.0.1");
      final Set<String> datacenters = Collections.emptySet();
      final int repairThreadCount = 1;
  
      final RepairUnit cf = RepairUnit.builder()
          .clusterName(clusterName)
          .keyspaceName(ksName)
          .columnFamilies(cfNames)
          .incrementalRepair(incrementalRepair)
          .nodes(nodes)
          .datacenters(datacenters)
          .repairThreadCount(repairThreadCount)
          .build(UUIDs.timeBased());
  
      double intensity = 0.5f;
  
      final RepairRun run = RepairRun.builder(clusterName, cf.getId())
              .intensity(intensity)
              .segmentCount(1)
              .repairParallelism(RepairParallelism.PARALLEL)
              .tables(TABLES)
              .build(UUIDs.timeBased());
  
      when(context.storage.updateRepairRun(any(), any())).thenReturn(true);
  
      intensity = 0.1;
      RepairRun updated = context.repairManager.updateRepairRunIntensity(run, intensity);
  
      Assertions.assertThat(updated.getId()).isEqualTo(run.getId());
      Assertions.assertThat(updated.getIntensity()).isEqualTo(intensity);
      Mockito.verify(context.storage, Mockito.times(1)).updateRepairRun(any(), any());
    }
test_case.class_method_signature: RepairManagerTest.updateRepairRunIntensityTest()
test_case.full_signature: @Test public void updateRepairRunIntensityTest()
test_case.identifier: updateRepairRunIntensityTest
test_case.invocations: mock addCluster build withSeedHosts withName builder of create newScheduledThreadPool newHashSet newHashSet emptySet build repairThreadCount datacenters nodes incrementalRepair columnFamilies keyspaceName clusterName builder timeBased build tables repairParallelism segmentCount intensity builder getId timeBased thenReturn when updateRepairRun any any updateRepairRunIntensity isEqualTo assertThat getId getId isEqualTo assertThat getIntensity updateRepairRun verify times any any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void updateRepairRunIntensityTest()
focal_class.declarator: LOG = LoggerFactory.getLogger(RepairManager.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(RepairManager.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: repairRunners = Maps.newConcurrentMap()
focal_class.modifier: final
focal_class.original_string: final Map<UUID, RepairRunner> repairRunners = Maps.newConcurrentMap();
focal_class.type: Map<UUID, RepairRunner>
focal_class.var_name: repairRunners
focal_class.declarator: repairRunnersLock = new ReentrantLock()
focal_class.modifier: private final
focal_class.original_string: private final Lock repairRunnersLock = new ReentrantLock();
focal_class.type: Lock
focal_class.var_name: repairRunnersLock
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: executor
focal_class.modifier: private final
focal_class.original_string: private final ListeningScheduledExecutorService executor;
focal_class.type: ListeningScheduledExecutorService
focal_class.var_name: executor
focal_class.declarator: repairTimeoutMillis
focal_class.modifier: private final
focal_class.original_string: private final long repairTimeoutMillis;
focal_class.type: long
focal_class.var_name: repairTimeoutMillis
focal_class.declarator: retryDelayMillis
focal_class.modifier: private final
focal_class.original_string: private final long retryDelayMillis;
focal_class.type: long
focal_class.var_name: retryDelayMillis
focal_class.file: src/server/src/main/java/io/cassandrareaper/service/RepairManager.java
focal_class.identifier: RepairManager
focal_class.interfaces: implements AutoCloseable
focal_class.class_method_signature: RepairManager.RepairManager(
        AppContext context,
        ClusterFacade clusterFacade,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.full_signature: private  RepairManager(
        AppContext context,
        ClusterFacade clusterFacade,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.identifier: RepairManager
focal_class.modifiers: private
focal_class.parameters: (
        AppContext context,
        ClusterFacade clusterFacade,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.signature:  RepairManager(
        AppContext context,
        ClusterFacade clusterFacade,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.class_method_signature: RepairManager.create(
        AppContext context,
        ClusterFacade clusterFacadeSupplier,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.full_signature: @VisibleForTesting static RepairManager create(
        AppContext context,
        ClusterFacade clusterFacadeSupplier,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.identifier: create
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: (
        AppContext context,
        ClusterFacade clusterFacadeSupplier,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.return: RepairManager
focal_class.signature: RepairManager create(
        AppContext context,
        ClusterFacade clusterFacadeSupplier,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.class_method_signature: RepairManager.create(
        AppContext context,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.full_signature: public static RepairManager create(
        AppContext context,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.identifier: create
focal_class.modifiers: public static
focal_class.parameters: (
        AppContext context,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.return: RepairManager
focal_class.signature: RepairManager create(
        AppContext context,
        ScheduledExecutorService executor,
        long repairTimeout,
        TimeUnit repairTimeoutTimeUnit,
        long retryDelay,
        TimeUnit retryDelayTimeUnit)
focal_class.class_method_signature: RepairManager.getRepairTimeoutMillis()
focal_class.full_signature:  long getRepairTimeoutMillis()
focal_class.identifier: getRepairTimeoutMillis
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getRepairTimeoutMillis()
focal_class.class_method_signature: RepairManager.resumeRunningRepairRuns()
focal_class.full_signature: public void resumeRunningRepairRuns()
focal_class.identifier: resumeRunningRepairRuns
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void resumeRunningRepairRuns()
focal_class.class_method_signature: RepairManager.abortAllRunningSegmentsWithNoLeader(Collection<RepairRun> runningRepairRuns)
focal_class.full_signature: private void abortAllRunningSegmentsWithNoLeader(Collection<RepairRun> runningRepairRuns)
focal_class.identifier: abortAllRunningSegmentsWithNoLeader
focal_class.modifiers: private
focal_class.parameters: (Collection<RepairRun> runningRepairRuns)
focal_class.return: void
focal_class.signature: void abortAllRunningSegmentsWithNoLeader(Collection<RepairRun> runningRepairRuns)
focal_class.class_method_signature: RepairManager.resumeUnkownRunningRepairRuns(Collection<RepairRun> runningRepairRuns)
focal_class.full_signature: private void resumeUnkownRunningRepairRuns(Collection<RepairRun> runningRepairRuns)
focal_class.identifier: resumeUnkownRunningRepairRuns
focal_class.modifiers: private
focal_class.parameters: (Collection<RepairRun> runningRepairRuns)
focal_class.return: void
focal_class.signature: void resumeUnkownRunningRepairRuns(Collection<RepairRun> runningRepairRuns)
focal_class.class_method_signature: RepairManager.abortAllRunningSegmentsInKnownPausedRepairRuns(Collection<RepairRun> pausedRepairRuns)
focal_class.full_signature: private void abortAllRunningSegmentsInKnownPausedRepairRuns(Collection<RepairRun> pausedRepairRuns)
focal_class.identifier: abortAllRunningSegmentsInKnownPausedRepairRuns
focal_class.modifiers: private
focal_class.parameters: (Collection<RepairRun> pausedRepairRuns)
focal_class.return: void
focal_class.signature: void abortAllRunningSegmentsInKnownPausedRepairRuns(Collection<RepairRun> pausedRepairRuns)
focal_class.class_method_signature: RepairManager.resumeUnknownPausedRepairRuns(Collection<RepairRun> pausedRepairRuns)
focal_class.full_signature: private void resumeUnknownPausedRepairRuns(Collection<RepairRun> pausedRepairRuns)
focal_class.identifier: resumeUnknownPausedRepairRuns
focal_class.modifiers: private
focal_class.parameters: (Collection<RepairRun> pausedRepairRuns)
focal_class.return: void
focal_class.signature: void resumeUnknownPausedRepairRuns(Collection<RepairRun> pausedRepairRuns)
focal_class.class_method_signature: RepairManager.abortSegmentsWithNoLeader(RepairRun repairRun, Collection<RepairSegment> runningSegments)
focal_class.full_signature: private void abortSegmentsWithNoLeader(RepairRun repairRun, Collection<RepairSegment> runningSegments)
focal_class.identifier: abortSegmentsWithNoLeader
focal_class.modifiers: private
focal_class.parameters: (RepairRun repairRun, Collection<RepairSegment> runningSegments)
focal_class.return: void
focal_class.signature: void abortSegmentsWithNoLeader(RepairRun repairRun, Collection<RepairSegment> runningSegments)
focal_class.class_method_signature: RepairManager.abortSegment(UUID runId, UUID segmentId)
focal_class.full_signature: public RepairSegment abortSegment(UUID runId, UUID segmentId)
focal_class.identifier: abortSegment
focal_class.modifiers: public
focal_class.parameters: (UUID runId, UUID segmentId)
focal_class.return: RepairSegment
focal_class.signature: RepairSegment abortSegment(UUID runId, UUID segmentId)
focal_class.class_method_signature: RepairManager.abortSegments(Collection<RepairSegment> runningSegments, RepairRun repairRun)
focal_class.full_signature:  void abortSegments(Collection<RepairSegment> runningSegments, RepairRun repairRun)
focal_class.identifier: abortSegments
focal_class.parameters: (Collection<RepairSegment> runningSegments, RepairRun repairRun)
focal_class.return: void
focal_class.signature: void abortSegments(Collection<RepairSegment> runningSegments, RepairRun repairRun)
focal_class.class_method_signature: RepairManager.startRepairRun(RepairRun runToBeStarted)
focal_class.full_signature: public RepairRun startRepairRun(RepairRun runToBeStarted)
focal_class.identifier: startRepairRun
focal_class.modifiers: public
focal_class.parameters: (RepairRun runToBeStarted)
focal_class.return: RepairRun
focal_class.signature: RepairRun startRepairRun(RepairRun runToBeStarted)
focal_class.class_method_signature: RepairManager.updateRepairRunIntensity(RepairRun repairRun, Double intensity)
focal_class.full_signature: public RepairRun updateRepairRunIntensity(RepairRun repairRun, Double intensity)
focal_class.identifier: updateRepairRunIntensity
focal_class.modifiers: public
focal_class.parameters: (RepairRun repairRun, Double intensity)
focal_class.return: RepairRun
focal_class.signature: RepairRun updateRepairRunIntensity(RepairRun repairRun, Double intensity)
focal_class.class_method_signature: RepairManager.startRunner(UUID runId)
focal_class.full_signature: private void startRunner(UUID runId)
focal_class.identifier: startRunner
focal_class.modifiers: private
focal_class.parameters: (UUID runId)
focal_class.return: void
focal_class.signature: void startRunner(UUID runId)
focal_class.class_method_signature: RepairManager.pauseRepairRun(RepairRun runToBePaused)
focal_class.full_signature: public RepairRun pauseRepairRun(RepairRun runToBePaused)
focal_class.identifier: pauseRepairRun
focal_class.modifiers: public
focal_class.parameters: (RepairRun runToBePaused)
focal_class.return: RepairRun
focal_class.signature: RepairRun pauseRepairRun(RepairRun runToBePaused)
focal_class.class_method_signature: RepairManager.abortRepairRun(RepairRun runToBeAborted)
focal_class.full_signature: public RepairRun abortRepairRun(RepairRun runToBeAborted)
focal_class.identifier: abortRepairRun
focal_class.modifiers: public
focal_class.parameters: (RepairRun runToBeAborted)
focal_class.return: RepairRun
focal_class.signature: RepairRun abortRepairRun(RepairRun runToBeAborted)
focal_class.class_method_signature: RepairManager.scheduleRetry(RepairRunner runner)
focal_class.full_signature:  void scheduleRetry(RepairRunner runner)
focal_class.identifier: scheduleRetry
focal_class.parameters: (RepairRunner runner)
focal_class.return: void
focal_class.signature: void scheduleRetry(RepairRunner runner)
focal_class.class_method_signature: RepairManager.submitSegment(SegmentRunner runner)
focal_class.full_signature:  ListenableFuture<?> submitSegment(SegmentRunner runner)
focal_class.identifier: submitSegment
focal_class.parameters: (SegmentRunner runner)
focal_class.return: ListenableFuture<?>
focal_class.signature: ListenableFuture<?> submitSegment(SegmentRunner runner)
focal_class.class_method_signature: RepairManager.removeRunner(RepairRunner runner)
focal_class.full_signature:  void removeRunner(RepairRunner runner)
focal_class.identifier: removeRunner
focal_class.parameters: (RepairRunner runner)
focal_class.return: void
focal_class.signature: void removeRunner(RepairRunner runner)
focal_class.class_method_signature: RepairManager.takeLead(AppContext context, UUID leaderElectionId)
focal_class.full_signature: private static boolean takeLead(AppContext context, UUID leaderElectionId)
focal_class.identifier: takeLead
focal_class.modifiers: private static
focal_class.parameters: (AppContext context, UUID leaderElectionId)
focal_class.return: boolean
focal_class.signature: boolean takeLead(AppContext context, UUID leaderElectionId)
focal_class.class_method_signature: RepairManager.renewLead(AppContext context, UUID leaderElectionId)
focal_class.full_signature: private static boolean renewLead(AppContext context, UUID leaderElectionId)
focal_class.identifier: renewLead
focal_class.modifiers: private static
focal_class.parameters: (AppContext context, UUID leaderElectionId)
focal_class.return: boolean
focal_class.signature: boolean renewLead(AppContext context, UUID leaderElectionId)
focal_class.class_method_signature: RepairManager.releaseLead(AppContext context, UUID leaderElectionId)
focal_class.full_signature: private static void releaseLead(AppContext context, UUID leaderElectionId)
focal_class.identifier: releaseLead
focal_class.modifiers: private static
focal_class.parameters: (AppContext context, UUID leaderElectionId)
focal_class.return: void
focal_class.signature: void releaseLead(AppContext context, UUID leaderElectionId)
focal_class.class_method_signature: RepairManager.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: public RepairRun updateRepairRunIntensity(RepairRun repairRun, Double intensity) throws ReaperException {
      RepairRun updatedRun = repairRun.with().intensity(intensity).build(repairRun.getId());
      if (!context.storage.updateRepairRun(updatedRun, Optional.of(false))) {
        throw new ReaperException("failed updating repair run " + updatedRun.getId());
      }
      return updatedRun;
    }
focal_method.class_method_signature: RepairManager.updateRepairRunIntensity(RepairRun repairRun, Double intensity)
focal_method.full_signature: public RepairRun updateRepairRunIntensity(RepairRun repairRun, Double intensity)
focal_method.identifier: updateRepairRunIntensity
focal_method.invocations: build intensity with getId updateRepairRun of getId
focal_method.modifiers: public
focal_method.parameters: (RepairRun repairRun, Double intensity)
focal_method.return: RepairRun
focal_method.signature: RepairRun updateRepairRunIntensity(RepairRun repairRun, Double intensity)