You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/07/08 05:53:17 UTC

[GitHub] [dolphinscheduler] ruanwenjun commented on a change in pull request #5766: [#5748][refactor]get more reasonable monitoring indexes of the zk cluster

ruanwenjun commented on a change in pull request #5766:
URL: https://github.com/apache/dolphinscheduler/pull/5766#discussion_r665889055



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZookeeperMonitor.java
##########
@@ -91,7 +89,7 @@
                 float avgLatency = state.getAvgLatency();
                 float maxLatency = state.getMaxLatency();
                 int nodeCount = state.getNodeCount();
-                int status = ok ? 1 : 0;
+                int status = state.isFlag() ? -1: (ok ? 1 : 0);

Review comment:
       I think return true or false to front-end may be better than returning 0,1

##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZooKeeperState.java
##########
@@ -43,6 +44,8 @@
 	private int watches = -1;
 	private int connections = -1;
 
+	private boolean flag = false;

Review comment:
       Can we use a different variable name, may be `healthFlag`?

##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java
##########
@@ -25,10 +25,7 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.SocketTimeoutException;
+import java.net.*;

Review comment:
       Don't use import *.
   https://stackoverflow.com/questions/147454/why-is-using-a-wild-card-with-a-java-import-statement-bad




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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