static List<File> getCompactedLogFilesInDescendingOrder(String dir, String storeId) {
    File storeDir = new File(dir);
    File[] files =
        storeDir.listFiles((fileDir, name) -> name.startsWith(storeId + COMPACTION_LOG_SUFFIX + BlobStore.SEPARATOR));
    if (files == null || files.length == 0) {
      return new ArrayList<>();
    }
    List<File> sortedFiles = Stream.of(files)
        .sorted((file1, file2) -> getStartTimeFromFile(file2) - getStartTimeFromFile(file1) > 0 ? 1 : -1)
        .collect(Collectors.toList());
    return sortedFiles;
  }
Get all the compaction file (not including inprogress compaction file) in descending order based on the start time
@param dir The data dir that contains all the compaction log files.
@param storeId The store id.
@return A list of {@link File}s that are sorted at descending order
ambry-store/src/main/java/com/github/ambry/store/CompactionLog.java