diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerUnseqCompactionWithReadPointPerformerTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerUnseqCompactionWithReadPointPerformerTest.java index a5affc18170f..95f9b38c24aa 100644 --- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerUnseqCompactionWithReadPointPerformerTest.java +++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/inner/InnerUnseqCompactionWithReadPointPerformerTest.java @@ -50,8 +50,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -127,7 +127,7 @@ public void test() throws Exception { for (CompactionOverlapType compactionOverlapType : compactionOverlapTypes) { List toMergeResources = new ArrayList<>(); for (int i = 0; i < toMergeFileNum; i++) { - Set fullPath = new HashSet<>(); + Set fullPath = new LinkedHashSet<>(); if (compactionTimeseriesType == CompactionTimeseriesType.ALL_SAME) { fullPath.add(fullPaths[0]); fullPath.add(fullPaths[1]); @@ -309,7 +309,7 @@ public void test() throws Exception { toMergeResources.add(tsFileResource); // has mods files before compaction if (compactionBeforeHasMod) { - Map> toDeleteTimeseriesAndTime = new HashMap<>(); + Map> toDeleteTimeseriesAndTime = new LinkedHashMap<>(); if (compactionTimeseriesType == CompactionTimeseriesType.ALL_SAME) { toDeleteTimeseriesAndTime.put( fullPaths[i], new Pair<>(i * 600L + 250L, i * 600L + 300L)); @@ -352,7 +352,7 @@ public void test() throws Exception { Map> sourceData = CompactionCheckerUtils.readFiles(toMergeResources); if (compactionHasMod) { - Map> toDeleteTimeseriesAndTime = new HashMap<>(); + Map> toDeleteTimeseriesAndTime = new LinkedHashMap<>(); toDeleteTimeseriesAndTime.put(fullPaths[1], new Pair<>(250L, 300L)); CompactionFileGeneratorUtils.generateMods( toDeleteTimeseriesAndTime, toMergeResources.get(0), true); @@ -379,7 +379,7 @@ public void test() throws Exception { List targetTsFileResources = new ArrayList<>(); targetTsFileResources.add(targetTsFileResource); CompactionCheckerUtils.checkDataAndResource(sourceData, targetTsFileResources); - Map>> chunkPagePointsNumMerged = new HashMap<>(); + Map>> chunkPagePointsNumMerged = new LinkedHashMap<>(); if (compactionTimeseriesType == CompactionTimeseriesType.ALL_SAME) { if (toMergeFileNum == 2) { if (compactionBeforeHasMod) { diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionFileGeneratorUtils.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionFileGeneratorUtils.java index 2573a95d1dad..591296974889 100644 --- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionFileGeneratorUtils.java +++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionFileGeneratorUtils.java @@ -45,7 +45,7 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -166,7 +166,7 @@ public static void writeTsFile( newTsFileResource.getTsFile().getParentFile().mkdirs(); } RestorableTsFileIOWriter writer = new RestorableTsFileIOWriter(newTsFileResource.getTsFile()); - Map> deviceMeasurementMap = new HashMap<>(); + Map> deviceMeasurementMap = new LinkedHashMap<>(); for (String fullPath : fullPaths) { PartialPath partialPath = new MeasurementPath(fullPath); List sensors = @@ -224,7 +224,7 @@ public static void writeChunkToTsFileWithTimeRange( TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(Integer.MAX_VALUE); RestorableTsFileIOWriter writer = new RestorableTsFileIOWriter(newTsFileResource.getTsFile()); - Map> deviceMeasurementMap = new HashMap<>(); + Map> deviceMeasurementMap = new LinkedHashMap<>(); for (String fullPath : fullPaths) { PartialPath partialPath = new MeasurementPath(fullPath); List sensors = @@ -313,7 +313,7 @@ public static void writeTsFile( newTsFileResource.getTsFile().getParentFile().mkdirs(); } RestorableTsFileIOWriter writer = new RestorableTsFileIOWriter(newTsFileResource.getTsFile()); - Map> deviceMeasurementMap = new HashMap<>(); + Map> deviceMeasurementMap = new LinkedHashMap<>(); for (String fullPath : fullPaths) { PartialPath partialPath = new PartialPath(fullPath); List sensors =