Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
Expand Down Expand Up @@ -423,15 +422,15 @@ public List<String> getAllDevices() throws IOException {
}

private List<String> getAllDevices(MetadataIndexNode metadataIndexNode) throws IOException {
Set<String> deviceSet = new TreeSet<>();
List<String> deviceList = new ArrayList<>();
int metadataIndexListSize = metadataIndexNode.getChildren().size();
for (int i = 0; i < metadataIndexListSize; i++) {
MetadataIndexEntry metadataIndex = metadataIndexNode.getChildren().get(i);
switch (metadataIndexNode.getNodeType()) {
case LEAF_MEASUREMENT:
case INTERNAL_MEASUREMENT:
for (MetadataIndexEntry index : metadataIndexNode.getChildren()) {
deviceSet.add(index.getName());
deviceList.add(index.getName());
}
break;
case LEAF_DEVICE:
Expand All @@ -442,11 +441,11 @@ private List<String> getAllDevices(MetadataIndexNode metadataIndexNode) throws I
}
ByteBuffer buffer = readData(metadataIndex.getOffset(), endOffset);
MetadataIndexNode node = MetadataIndexNode.deserializeFrom(buffer);
deviceSet.addAll(getAllDevices(node));
deviceList.addAll(getAllDevices(node));
break;
}
}
return new ArrayList<>(deviceSet);
return deviceList;
}

/**
Expand Down