Skip to content
Merged
Show file tree
Hide file tree
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 @@ -128,7 +128,7 @@ private static void compactAlignedSeries(
QueryContext queryContext,
QueryDataSource queryDataSource)
throws IOException, MetadataException {
Map<String, MeasurementSchema> schemaMap = deviceIterator.getAllMeasurementSchemas();
Map<String, MeasurementSchema> schemaMap = deviceIterator.getAllSchemasOfCurrentDevice();

List<IMeasurementSchema> measurementSchemas = new ArrayList<>(schemaMap.values());
if (measurementSchemas.isEmpty()) {
Expand Down Expand Up @@ -165,7 +165,8 @@ private static void compactNonAlignedSeries(
QueryContext queryContext,
QueryDataSource queryDataSource)
throws IOException, InterruptedException {
Map<String, MeasurementSchema> measurementSchemaMap = deviceIterator.getAllMeasurementSchemas();
Map<String, MeasurementSchema> measurementSchemaMap =
deviceIterator.getAllSchemasOfCurrentDevice();
int subTaskNums = Math.min(measurementSchemaMap.size(), subTaskNum);

// assign all measurements to different sub tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public Pair<String, Boolean> nextDevice() {
* files from the newest to the oldest in turn and start traversing the index tree from the
* firstMeasurementNode node to get all the measurements under the current device.
*/
public Map<String, MeasurementSchema> getAllMeasurementSchemas() throws IOException {
public Map<String, MeasurementSchema> getAllSchemasOfCurrentDevice() throws IOException {
Map<String, MeasurementSchema> schemaMap = new ConcurrentHashMap<>();
// get schemas from the newest file to the oldest file
for (TsFileResource resource : tsFileResources) {
Expand All @@ -150,7 +150,7 @@ public Map<String, MeasurementSchema> getAllMeasurementSchemas() throws IOExcept
List<TimeseriesMetadata> timeseriesMetadataList = new ArrayList<>();
reader.getDeviceTimeseriesMetadata(
timeseriesMetadataList,
deviceIteratorMap.get(resource).getMeasurementNode(),
deviceIteratorMap.get(resource).getFirstMeasurementNodeOfCurrentDevice(),
schemaMap.keySet(),
true);
for (TimeseriesMetadata timeseriesMetadata : timeseriesMetadataList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Pair<String, Boolean> next() {
}
Pair<String, Pair<Long, Long>> startEndPair = queue.remove();
try {
// first measurement node of this device
// get the first measurment node of this device, to know if the device is alignd
MetadataIndexNode measurementNode =
MetadataIndexNode.deserializeFrom(
reader.readData(startEndPair.right.left, startEndPair.right.right));
Expand All @@ -71,7 +71,7 @@ public Pair<String, Boolean> next() {
}
}

public MetadataIndexNode getMeasurementNode() {
public MetadataIndexNode getFirstMeasurementNodeOfCurrentDevice() {
return measurementNode;
}
}