You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/02/13 07:19:27 UTC

[incubator-iotdb] 01/01: Revert "[IOTDB-471] fix bug (#786)"

This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch revert-786-IOTDB-471-fix-bug
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit a8a6cc3ebb04510a05b85d06149b0164fcdea273
Author: Jialin Qiao <qj...@mails.tsinghua.edu.cn>
AuthorDate: Thu Feb 13 15:19:18 2020 +0800

    Revert "[IOTDB-471] fix bug (#786)"
    
    This reverts commit 6ddb2c3a40532f4aa06a9fb9a71319f00dac68d2.
---
 .../db/engine/storagegroup/StorageGroupProcessor.java     | 15 +++------------
 .../iotdb/db/engine/storagegroup/TsFileProcessor.java     |  1 +
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
index ff32e32..4b6bed8 100755
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
@@ -1234,18 +1234,9 @@ public class StorageGroupProcessor {
 
   private boolean updateLatestFlushTimeCallback(TsFileProcessor processor) {
     // update the largest timestamp in the last flushing memtable
-    Map<String, Long> curPartitionDeviceLatestTime = latestTimeForEachDevice
-        .get(processor.getTimeRangeId());
-    
-    if(curPartitionDeviceLatestTime == null){
-      logger.warn("Partition: " + processor.getTimeRangeId() +
-          " does't have latest time for each device record.");
-      return false;
-    }
-
-    for (Entry<String, Long> entry : curPartitionDeviceLatestTime.entrySet()) {
-      latestFlushedTimeForEachDevice
-          .computeIfAbsent(processor.getTimeRangeId(), id -> new HashMap<>())
+    for (Entry<String, Long> entry : latestTimeForEachDevice.get(processor.getTimeRangeId())
+        .entrySet()) {
+      latestFlushedTimeForEachDevice.get(processor.getTimeRangeId())
           .put(entry.getKey(), entry.getValue());
     }
     return true;
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
index c680a7c..a90debd 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
@@ -505,6 +505,7 @@ public class TsFileProcessor {
     tsFileResource.serialize();
     writer.endFile(schema);
     tsFileResource.cleanCloseFlag();
+    tsFileResource.close();
 
     // remove this processor from Closing list in StorageGroupProcessor,
     // mark the TsFileResource closed, no need writer anymore