You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/04/01 09:49:01 UTC

[GitHub] [iotdb] liu-hai commented on a change in pull request #2961: [ISSUE-2911]Fix The write stream is not closed when executing the command 'tracing off' , The previous branch 'fix_tracing' was broken and I checked out a new branch to submit

liu-hai commented on a change in pull request #2961:
URL: https://github.com/apache/iotdb/pull/2961#discussion_r605523002



##########
File path: server/src/main/java/org/apache/iotdb/db/query/control/TracingManager.java
##########
@@ -198,8 +198,46 @@ public void writeEndTime(long queryId) throws IOException {
     writer.flush();
   }
 
-  public void close() throws IOException {
-    writer.close();
+  public void close() {
+    try {
+      writer.close();
+    } catch (IOException e) {
+      logger.error("Meeting error while Close the tracing log stream : {}", e.getMessage());
+    }
+  }
+
+  public boolean getWriterStatus() {
+    try {
+      writer.flush();
+      return true;
+    } catch (IOException e) {
+      return false;
+    }
+  }
+
+  public void openTracingWriteStream() {
+    File tracingDir =
+        SystemFileFactory.INSTANCE.getFile(
+            IoTDBDescriptor.getInstance().getConfig().getTracingDir());
+    if (!tracingDir.exists()) {
+      if (tracingDir.mkdirs()) {
+        logger.info("create performance folder {}.", tracingDir);
+      } else {
+        logger.info("create performance folder {} failed.", tracingDir);
+      }
+    }

Review comment:
       no problem




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org