public static void clearAllCompactionFiles() throws IOException {
    FileReaderManager.getInstance().closeAndRemoveAllOpenedReaders();
    deleteAllFilesInOneDirBySuffix("target", TsFileConstant.TSFILE_SUFFIX);
    deleteAllFilesInOneDirBySuffix("target", TsFileResource.RESOURCE_SUFFIX);
    deleteAllFilesInOneDirBySuffix("target", ModificationFile.FILE_SUFFIX);
    deleteAllFilesInOneDirBySuffix("target", IoTDBConstant.INNER_COMPACTION_TMP_FILE_SUFFIX);
    deleteAllFilesInOneDirBySuffix("target", IoTDBConstant.CROSS_COMPACTION_TMP_FILE_SUFFIX);
    deleteAllFilesInOneDirBySuffix("target", CompactionLogger.INNER_COMPACTION_LOG_NAME_SUFFIX);
    deleteAllFilesInOneDirBySuffix("target", CompactionLogger.CROSS_COMPACTION_LOG_NAME_SUFFIX);
    // clean cache
    if (IoTDBDescriptor.getInstance().getMemoryConfig().isMetaDataCacheEnable()) {
      ChunkCache.getInstance().clear();
      TimeSeriesMetadataCache.getInstance().clear();
      BloomFilterCache.getInstance().clear();
    }
    FileReaderManager.getInstance().closeAndRemoveAllOpenedReaders();
  }
Clear all generated and merged files in the test directory
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionClearUtils.java