Source:
void resumeCompaction() throws StoreException { if (srcIndex == null) { throw new IllegalStateException("Compactor has not been initialized"); } else if (compactionLog == null) { throw new IllegalStateException("There is no compaction to resume"); } runningLatch = new CountDownLatch(1); logger.trace("Resuming compaction"); try { compactionInProgress.set(true); while (isActive && !compactionLog.getCompactionPhase().equals(CompactionLog.Phase.DONE)) { CompactionLog.Phase phase = compactionLog.getCompactionPhase(); logger.debug("Starting cycle to compact in {}", compactionLog.getCompactionDetails(), dataDir); switch (phase) { case PREPARE: logger.debug("Compaction PREPARE started for in {}", compactionLog.getCompactionDetails(), dataDir); compactionLog.markCopyStart(); case COPY: logger.debug("Compaction COPY started for in {}", compactionLog.getCompactionDetails(), dataDir); copy(); if (isActive) { compactionLog.markCommitStart(); logger.debug("Compaction COMMIT started for in {}", compactionLog.getCompactionDetails(), dataDir); commit(false); compactionLog.markCleanupStart(); logger.debug("Compaction CLEANUP started for in {}", compactionLog.getCompactionDetails(), dataDir); waitTillRefCountZero(); logger.debug("Wait for ref count to go to 0 has been finished in {}", compactionLog.getCompactionDetails(), dataDir); cleanup(false); logger.debug("Completing for in {}", compactionLog.getCompactionDetails(), dataDir); compactionLog.markCycleComplete(); } break; default: throw new IllegalStateException("Illegal compaction phase: " + phase); } } compactionInProgress.set(false); endCompaction(); } catch (InterruptedException | IOException e) { throw new StoreException("Exception during compaction", e, StoreErrorCodes.Unknown_Error); } finally { runningLatch.countDown(); } logger.trace("resumeCompaction() ended"); }

Target:
void resumeCompaction() throws StoreException { if (srcIndex == null) { throw new IllegalStateException("Compactor has not been initialized"); } else if (compactionLog == null) { throw new IllegalStateException("There is no compaction to resume"); } logger.trace("resumeCompaction() started for {}", storeId); runningLatch = new CountDownLatch(1); compactionInProgress.set(true); try { while (isActive && !compactionLog.getCompactionPhase().equals(CompactionLog.Phase.DONE)) { CompactionLog.Phase phase = compactionLog.getCompactionPhase(); logger.debug("Starting cycle to compact in {}", compactionLog.getCompactionDetails(), storeId); switch (phase) { case PREPARE: logger.debug("Compaction PREPARE started for in {}", compactionLog.getCompactionDetails(), storeId); compactionLog.markCopyStart(); case COPY: logger.debug("Compaction COPY started for in {}", compactionLog.getCompactionDetails(), storeId); copy(); if (isActive) { compactionLog.markCommitStart(); logger.debug("Compaction COMMIT started for in {}", compactionLog.getCompactionDetails(), storeId); commit(false); compactionLog.markCleanupStart(); logger.debug("Compaction CLEANUP started for in {}", compactionLog.getCompactionDetails(), storeId); waitTillRefCountZero(); logger.debug("Wait for ref count to go to 0 has been finished in {}", compactionLog.getCompactionDetails(), storeId); cleanup(false); logger.debug("Completing for in {}", compactionLog.getCompactionDetails(), storeId); compactionLog.markCycleComplete(); } break; default: throw new IllegalStateException("Illegal compaction phase: " + phase); } } endCompaction(); } catch (InterruptedException | IOException e) { throw new StoreException("Exception during compaction", e, StoreErrorCodes.Unknown_Error); } finally { compactionInProgress.set(false); runningLatch.countDown(); logger.trace("resumeCompaction() ended for {}", storeId); } }