This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch tsFile_v4
in repository https://gitbox.apache.org/repos/asf/tsfile.git
The following commit(s) were added to refs/heads/tsFile_v4 by this push:
new 320ce456 Use TreeMap to guarantee order
320ce456 is described below
commit 320ce456a90c69662b85ed68e812d937f386c2f5
Author: jt2594838 <[email protected]>
AuthorDate: Fri Apr 12 15:37:07 2024 +0800
Use TreeMap to guarantee order
---
.../org/apache/tsfile/file/metadata/MetadataIndexConstructor.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/tsfile/src/main/java/org/apache/tsfile/file/metadata/MetadataIndexConstructor.java
b/tsfile/src/main/java/org/apache/tsfile/file/metadata/MetadataIndexConstructor.java
index 875efe79..77b07897 100644
---
a/tsfile/src/main/java/org/apache/tsfile/file/metadata/MetadataIndexConstructor.java
+++
b/tsfile/src/main/java/org/apache/tsfile/file/metadata/MetadataIndexConstructor.java
@@ -19,6 +19,7 @@
package org.apache.tsfile.file.metadata;
+import java.util.TreeSet;
import org.apache.tsfile.common.conf.TSFileConfig;
import org.apache.tsfile.common.conf.TSFileDescriptor;
import org.apache.tsfile.file.IMetadataIndexEntry;
@@ -91,11 +92,11 @@ public class MetadataIndexConstructor {
public static Map<String, Map<IDeviceID, MetadataIndexNode>>
splitDeviceByTable(
Map<IDeviceID, MetadataIndexNode> deviceMetadataIndexMap) {
- Map<String, Map<IDeviceID, MetadataIndexNode>> result = new HashMap<>();
+ Map<String, Map<IDeviceID, MetadataIndexNode>> result = new TreeMap<>();
for (Entry<IDeviceID, MetadataIndexNode> entry :
deviceMetadataIndexMap.entrySet()) {
IDeviceID deviceID = entry.getKey();
String tableName = deviceID.getTableName();
- result.computeIfAbsent(tableName, tName -> new
HashMap<>()).put(deviceID, entry.getValue());
+ result.computeIfAbsent(tableName, tName -> new
TreeMap<>()).put(deviceID, entry.getValue());
}
return result;
}