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 2022/06/21 07:44:55 UTC

[GitHub] [iotdb] wangchao316 commented on a diff in pull request #6340: [IOTDB-3536] ConfigNode : org.apache.thrift.TException: Error in calling method flush

wangchao316 commented on code in PR #6340:
URL: https://github.com/apache/iotdb/pull/6340#discussion_r902267116


##########
confignode/src/main/java/org/apache/iotdb/confignode/client/AsyncDataNodeClientPool.java:
##########
@@ -264,6 +266,22 @@ public void dropFunction(
     }
   }
 
+  /**
+   * Flush on specific DataNode
+   *
+   * @param endPoint The specific DataNode
+   */
+  public void flush(TEndPoint endPoint, TFlushReq flushReq, FlushHandler handler) {

Review Comment:
   why does use aync client?



##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/NodeManager.java:
##########
@@ -252,4 +257,26 @@ public interface ChangeServerListener {
      */
     void removeDataNode(final TDataNodeLocation dataNodeInfo);
   }
+
+  public List<TSStatus> flush(TFlushReq req) {
+    List<TDataNodeInfo> onlineDataNodes =
+        configManager.getNodeManager().getOnlineDataNodes(req.dataNodeId);
+    List<TSStatus> dataNodeResponseStatus =
+        Collections.synchronizedList(new ArrayList<>(onlineDataNodes.size()));
+    CountDownLatch countDownLatch = new CountDownLatch(onlineDataNodes.size());
+    for (TDataNodeInfo dataNodeInfo : onlineDataNodes) {
+      AsyncDataNodeClientPool.getInstance()
+          .flush(
+              dataNodeInfo.getLocation().getInternalEndPoint(),
+              req,
+              new FlushHandler(dataNodeInfo.getLocation(), countDownLatch, dataNodeResponseStatus));
+    }
+    try {
+      countDownLatch.await();
+    } catch (InterruptedException e) {
+      Thread.currentThread().interrupt();
+      LOGGER.error("ClusterSchemaManager was interrupted during flushing on data nodes", e);

Review Comment:
   ClusterSchemaManager?



-- 
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: reviews-unsubscribe@iotdb.apache.org

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