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 12:01:20 UTC

[incubator-iotdb] branch feature_async_close_tsfile updated: add detailed log for swith status between flush and work

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 94ea939  add detailed log for swith status between flush and work
94ea939 is described below

commit 94ea939a4422d3942bd676e1220ac209c042b130
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Thu Jun 6 20:01:07 2019 +0800

    add detailed log for swith status between flush and work
---
 .../apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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 19e4d4c..2a458fd 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
@@ -271,7 +271,9 @@ public class BufferWriteProcessor extends Processor {
   }
 
   private void switchWorkToFlush() {
+    LOGGER.info("BufferWrite Processor {} try to get flushQueryLock for switchWorkToFlush", getProcessorName());
     flushQueryLock.lock();
+    LOGGER.info("BufferWrite Processor {} get flushQueryLock for switchWorkToFlush successfully", getProcessorName());
     try {
       IMemTable temp = flushMemTable == null ? new PrimitiveMemTable() : flushMemTable;
       flushMemTable = workMemTable;
@@ -279,17 +281,21 @@ public class BufferWriteProcessor extends Processor {
       isFlush = true;
     } finally {
       flushQueryLock.unlock();
+      LOGGER.info("BufferWrite Processor {} release the flushQueryLock for switchWorkToFlush successfully", getProcessorName());
     }
   }
 
   private void switchFlushToWork() {
+    LOGGER.info("BufferWrite Processor {} try to get flushQueryLock for switchFlushToWork", getProcessorName());
     flushQueryLock.lock();
+    LOGGER.info("BufferWrite Processor {} get flushQueryLock for switchFlushToWork", getProcessorName());
     try {
       flushMemTable.clear();
       writer.appendMetadata();
       isFlush = false;
     } finally {
       flushQueryLock.unlock();
+      LOGGER.info("BufferWrite Processor {} release the flushQueryLock for switchFlushToWork successfully", getProcessorName());
     }
   }
 
@@ -372,7 +378,7 @@ public class BufferWriteProcessor extends Processor {
       flushFuture.get();
       long timeCost = System.currentTimeMillis() - startTime;
       if (timeCost > 10) {
-        LOGGER.info("wait for the previous flushing task for {} ms.", timeCost);
+        LOGGER.info("BufferWrite Processor {} wait for the previous flushing task for {} ms.", getProcessorName(), timeCost);
       }
     } catch (InterruptedException | ExecutionException e) {
       throw new IOException(e);
@@ -388,6 +394,7 @@ public class BufferWriteProcessor extends Processor {
       final long walTaskId;
       if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
         walTaskId = logNode.notifyStartFlush();
+        LOGGER.info("BufferWrite Processor {} has notified WAL for flushing.", getProcessorName());
       } else {
         walTaskId = 0;
       }