HTHou commented on code in PR #12271:
URL: https://github.com/apache/iotdb/pull/12271#discussion_r1582164901
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java:
##########
@@ -1105,18 +1103,15 @@ private void
tryToUpdateInsertTabletLastCache(InsertTabletNode node) {
latestFlushedTime);
}
- private void insertToTsFileProcessor(
- InsertRowNode insertRowNode,
- boolean sequence,
- long timePartitionId,
- Map<TsFileProcessor, Boolean> tsFileProcessorMapForFlushing)
+ private TsFileProcessor insertToTsFileProcessor(
+ InsertRowNode insertRowNode, boolean sequence, long timePartitionId)
throws WriteProcessException {
if (insertRowNode.allMeasurementFailed()) {
- return;
+ return null;
}
TsFileProcessor tsFileProcessor =
getOrCreateTsFileProcessor(timePartitionId, sequence);
if (tsFileProcessor == null) {
- return;
+ return null;
}
Review Comment:
fixed
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java:
##########
@@ -885,16 +885,14 @@ public void insert(InsertRowNode insertRowNode) throws
WriteProcessException {
&& insertRowNode.getTime()
> lastFlushTimeMap.getFlushedTime(timePartitionId,
insertRowNode.getDeviceID());
- Map<TsFileProcessor, Boolean> tsFileProcessorMapForFlushing = new
HashMap<>();
-
// insert to sequence or unSequence file
- insertToTsFileProcessor(
- insertRowNode, isSequence, timePartitionId,
tsFileProcessorMapForFlushing);
+ TsFileProcessor tsFileProcessor =
+ insertToTsFileProcessor(insertRowNode, isSequence, timePartitionId);
// check memtable size and may asyncTryToFlush the work memtable
- for (Map.Entry<TsFileProcessor, Boolean> entry :
tsFileProcessorMapForFlushing.entrySet()) {
- if (entry.getKey().shouldFlush()) {
- fileFlushPolicy.apply(this, entry.getKey(), entry.getValue());
+ if (tsFileProcessor != null) {
+ if (tsFileProcessor.shouldFlush()) {
Review Comment:
fixed
--
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]