private void backUpCompactionPolicyInfo(String dataDir, CompactionPolicySwitchInfo compactionPolicySwitchInfo) {
    if (dataDir != null && !dataDir.isEmpty()) {
      File tempFile = new File(dataDir, COMPACT_POLICY_INFO_FILE_NAME_V2 + ".temp");
      try {
        tempFile.createNewFile();
        objectMapper.writerWithDefaultPrettyPrinter().writeValue(tempFile, compactionPolicySwitchInfo);
        tempFile.renameTo(new File(dataDir, COMPACT_POLICY_INFO_FILE_NAME_V2));
      } catch (IOException e) {
        logger.error("Exception while store compaction policy info for local report. Output file path - {}",
            tempFile.getAbsolutePath(), e);
      }
    }
  }
Back up {@link CompactionPolicySwitchInfo} in Json format for certain {@link BlobStore}
@param dataDir The directory to store the file.
@param compactionPolicySwitchInfo the info to determine which {@link CompactionPolicy} to use this round.
ambry-store/src/main/java/com/github/ambry/store/HybridCompactionPolicy.java