You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2019/06/06 08:47:28 UTC

[incubator-iotdb] branch feature_async_close_tsfile updated: fix bufferwrite flush log error

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

hxd pushed a commit to branch feature_async_close_tsfile
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/feature_async_close_tsfile by this push:
     new cdc2670  fix bufferwrite flush log error
     new a1fb10e  Merge branch 'feature_async_close_tsfile' of github.com:apache/incubator-iotdb into feature_async_close_tsfile
cdc2670 is described below

commit cdc2670fd43af72602b6299ba8d05a0125097520
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Thu Jun 6 16:44:02 2019 +0800

    fix bufferwrite flush log error
---
 .../iotdb/db/engine/bufferwrite/BufferWriteProcessor.java      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
index 987b35d..61a9f39 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
@@ -75,7 +75,7 @@ public class BufferWriteProcessor extends Processor {
   private Consumer<BufferWriteProcessor> bufferwriteCloseConsumer;
   private Action filenodeFlushAction;
 
-  //lastFlushTime time unit: nanosecond
+  //lastFlushTime time unit: millisecond
   private long lastFlushTime = -1;
   private long valueCount = 0;
 
@@ -358,12 +358,12 @@ public class BufferWriteProcessor extends Processor {
         LOGGER.info(
             "The bufferwrite processor {}: last flush time is {}, this flush time is {}, "
                 + "flush time interval is {}s", getProcessorName(),
-            DatetimeUtils.convertMillsecondToZonedDateTime(lastFlushTime / 1000),
+            DatetimeUtils.convertMillsecondToZonedDateTime(lastFlushTime),
             DatetimeUtils.convertMillsecondToZonedDateTime(thisFlushTime),
-            (thisFlushTime - lastFlushTime / 1000) / 1000);
+            (thisFlushTime - lastFlushTime) / 1000);
       }
     }
-    lastFlushTime = System.nanoTime();
+    lastFlushTime = System.currentTimeMillis();
     // check value count
     // waiting for the end of last flush operation.
     try {
@@ -536,7 +536,7 @@ public class BufferWriteProcessor extends Processor {
 
   /**
    * used for test. We can know when the flush() is called.
-   * @return the last flush() time. Time unit: nanosecond.
+   * @return the last flush() time. Time unit: millisecond.
    */
   public long getLastFlushTime() {
     return lastFlushTime;