private boolean compactionPolicySwitchInfoCounterValueReached() {
    File file = new File(dataDir, COMPACT_POLICY_INFO_FILE_NAME_V2);
    if (file.exists()) {
      CompactionPolicySwitchInfo compactionPolicySwitchInfo = null;
      try {
        compactionPolicySwitchInfo = objectMapper.readValue(file, CompactionPolicySwitchInfo.class);
      } catch (IOException e) {
        logger.error("Could not deserialize file : {} into {} Object", file,
            CompactionPolicySwitchInfo.class.getName());
        return false;
      }
      if (compactionPolicySwitchInfo.isNextRoundCompactAllPolicy()) {
        logger.trace("The compaction policy switch counter value is qualified for closing last log segment.");
        return true;
      } else {
        logger.trace("Next round of compaction is not CompactAllPolicy");
        return false;
      }
    } else {
      logger.error("Compaction policy file: {} is not exist in dir: {}", COMPACT_POLICY_INFO_FILE_NAME_V2, dataDir);
      return false;
    }
  }
@return {@code True} if next round is compact all policy.
ambry-store/src/main/java/com/github/ambry/store/Log.java