@Override
  public CompactionDetails getCompactionDetails(long totalCapacity, long usedCapacity, long segmentCapacity,
      long segmentHeaderSize, List<LogSegmentName> logSegmentsNotInJournal, BlobStoreStats blobStoreStats,
      String dataDir) throws StoreException {
    String storeId = blobStoreStats.getStoreId();
    CompactionPolicySwitchInfo compactionPolicySwitchInfo =
        getCompactionPolicySwitchInfo(storeId, dataDir, blobStoreStats);
    CompactionPolicy selectCompactionPolicy =
        selectCompactionPolicyAndUpdateCompactionPolicySwitchInfo(compactionPolicySwitchInfo, storeId, dataDir);
    logger.info("Current compaction policy  is : {} for store : {}, dataDir : {}", selectCompactionPolicy, storeId,
        dataDir);
    backUpCompactionPolicyInfo(dataDir, compactionPolicySwitchInfo);
    return selectCompactionPolicy.getCompactionDetails(totalCapacity, usedCapacity, segmentCapacity, segmentHeaderSize,
        logSegmentsNotInJournal, blobStoreStats, dataDir);
  }
@param totalCapacity Total capacity of the {@link BlobStore}
@param usedCapacity Used capacity of the {@link BlobStore}
@param segmentCapacity Segment capacity of a {@link LogSegment}
@param segmentHeaderSize Segment header size of a {@link LogSegment}
@param logSegmentsNotInJournal {@link List<String> } of log segment names which has non overlapping entries with
                               {@link Journal}
@param blobStoreStats {@link BlobStoreStats} pertaining to the {@link BlobStore} for which
{@link CompactionDetails} are requested
@param dataDir the dir to store {@link CompactionPolicySwitchInfo}
@return {@link CompactAllPolicy} or {@link StatsBasedCompactionPolicy}'s {@link CompactionDetails} depends on the switching rules.
ambry-store/src/main/java/com/github/ambry/store/HybridCompactionPolicy.java