|
70 | 70 | import java.nio.ByteBuffer; |
71 | 71 | import java.util.ArrayList; |
72 | 72 | import java.util.Collection; |
| 73 | +import java.util.Comparator; |
73 | 74 | import java.util.HashMap; |
74 | | -import java.util.HashSet; |
75 | 75 | import java.util.Iterator; |
| 76 | +import java.util.LinkedHashSet; |
76 | 77 | import java.util.LinkedList; |
77 | 78 | import java.util.List; |
78 | 79 | import java.util.Map; |
@@ -532,15 +533,18 @@ public static Map<IFullPath, List<TimeValuePair>> getAllDataByQuery( |
532 | 533 |
|
533 | 534 | public static List<IFullPath> getAllPathsOfResources(List<TsFileResource> resources) |
534 | 535 | throws IOException, IllegalPathException { |
535 | | - Set<IFullPath> paths = new HashSet<>(); |
| 536 | + Set<IFullPath> paths = new LinkedHashSet<>(); |
536 | 537 | try (MultiTsFileDeviceIterator deviceIterator = new MultiTsFileDeviceIterator(resources)) { |
537 | 538 | while (deviceIterator.hasNextDevice()) { |
538 | 539 | Pair<IDeviceID, Boolean> iDeviceIDBooleanPair = deviceIterator.nextDevice(); |
539 | 540 | IDeviceID deviceID = iDeviceIDBooleanPair.getLeft(); |
540 | 541 | boolean isAlign = iDeviceIDBooleanPair.getRight(); |
541 | 542 | Map<String, MeasurementSchema> schemaMap = deviceIterator.getAllSchemasOfCurrentDevice(); |
542 | 543 | IMeasurementSchema timeSchema = schemaMap.remove(TsFileConstant.TIME_COLUMN_ID); |
543 | | - List<IMeasurementSchema> measurementSchemas = new ArrayList<>(schemaMap.values()); |
| 544 | + List<IMeasurementSchema> measurementSchemas = |
| 545 | + schemaMap.values().stream() |
| 546 | + .sorted(Comparator.comparing(IMeasurementSchema::getMeasurementName)) |
| 547 | + .collect(Collectors.toList()); |
544 | 548 | if (measurementSchemas.isEmpty()) { |
545 | 549 | continue; |
546 | 550 | } |
|
0 commit comments