cigarl commented on a change in pull request #4537:
URL: https://github.com/apache/iotdb/pull/4537#discussion_r769481257
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/inplace/manage/CrossSpaceMergeResource.java
##########
@@ -103,12 +103,15 @@ public void clear() throws IOException {
fileReaderCache.clear();
fileWriterCache.clear();
modificationCache.clear();
- measurementSchemaMap.clear();
chunkWriterCache.clear();
}
public IMeasurementSchema getSchema(PartialPath path) {
- return measurementSchemaMap.get(path);
+ try {
+ return IoTDB.metaManager.getMeasurementMNode(path).getSchema();
+ } catch (MetadataException e) {
+ return null;
+ }
Review comment:
done
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/inplace/task/MergeMultiChunkTask.java
##########
@@ -112,33 +115,42 @@ public MergeMultiChunkTask(
InplaceCompactionLogger inplaceCompactionLogger,
CrossSpaceMergeResource mergeResource,
boolean fullMerge,
- List<PartialPath> unmergedSeries,
+ List<PartialPath> unmergedDevice,
int concurrentMergeSeriesNum,
String storageGroupName) {
this.mergeContext = context;
this.taskName = taskName;
this.inplaceCompactionLogger = inplaceCompactionLogger;
this.resource = mergeResource;
this.fullMerge = fullMerge;
- this.unmergedSeries = unmergedSeries;
+ this.unmergedDevice = unmergedDevice;
this.concurrentMergeSeriesNum = concurrentMergeSeriesNum;
this.storageGroupName = storageGroupName;
}
void mergeSeries() throws IOException {
- if (logger.isInfoEnabled()) {
- logger.info("{} starts to merge {} series", taskName,
unmergedSeries.size());
- }
long startTime = System.currentTimeMillis();
for (TsFileResource seqFile : resource.getSeqFiles()) {
// record the unmergeChunkStartTime for each sensor in each file
mergeContext.getUnmergedChunkStartTimes().put(seqFile, new HashMap<>());
}
+ mergedDeviceCnt = 0;
// merge each series and write data into each seqFile's corresponding temp
merge file
- List<List<PartialPath>> devicePaths =
MergeUtils.splitPathsByDevice(unmergedSeries);
- for (List<PartialPath> pathList : devicePaths) {
+ for (PartialPath device : unmergedDevice) {
// TODO: use statistics of queries to better rearrange series
- IMergePathSelector pathSelector = new NaivePathSelector(pathList,
concurrentMergeSeriesNum);
+ List<PartialPath> measurementPathListByDevice;
+ try {
+ measurementPathListByDevice =
+ new
ArrayList<>(IoTDB.metaManager.getAllMeasurementByDevicePath(device));
Review comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]