JackieTien97 commented on code in PR #16441:
URL: https://github.com/apache/iotdb/pull/16441#discussion_r2422612070


##########
iotdb-client/session/src/main/java/org/apache/iotdb/session/NodesSupplier.java:
##########
@@ -228,28 +229,37 @@ public Optional<TEndPoint> getQueryEndPoint() {
 
   private boolean updateDataNodeList() {
     try (SessionDataSet sessionDataSet =
-        client.executeQueryStatement(SHOW_DATA_NODES_COMMAND, TIMEOUT_IN_MS, 
FETCH_SIZE)) {
-      SessionDataSet.DataIterator iterator = sessionDataSet.iterator();
-      List<TEndPoint> res = new ArrayList<>();
-      while (iterator.next()) {
-        String ip = iterator.getString(IP_COLUMN_NAME);
-        // ignore 0.0.0.0 and removing DN
-        if (!REMOVING_STATUS.equals(iterator.getString(STATUS_COLUMN_NAME))
-            && !"0.0.0.0".equals(ip)) {
-          String port = iterator.getString(PORT_COLUMN_NAME);
-          if (ip != null && port != null) {
-            res.add(new TEndPoint(ip, Integer.parseInt(port)));
-          }
-        }
+        client.executeQueryStatement(SHOW_AVAILABLE_URLS_COMMAND, 
TIMEOUT_IN_MS, FETCH_SIZE)) {
+      updateAvailableNodes(sessionDataSet);
+    } catch (Exception e1) {
+      try (SessionDataSet sessionDataSet =
+          client.executeQueryStatement(SHOW_DATA_NODES_COMMAND, TIMEOUT_IN_MS, 
FETCH_SIZE)) {
+        updateAvailableNodes(sessionDataSet);
+      } catch (Exception e2) {

Review Comment:
   no need to do this compatibility



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to