This is an automated email from the ASF dual-hosted git repository. tanxinyu pushed a commit to branch session_nodeurl_shuffle in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 9a49203fa0987d6b2b8bdfc52779ce0ddf635947 Author: OneSizeFitQuorum <[email protected]> AuthorDate: Fri Feb 28 10:05:25 2025 +0800 enhance Signed-off-by: OneSizeFitQuorum <[email protected]> --- .../session/src/main/java/org/apache/iotdb/session/Session.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java b/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java index 6908cad0632..357203563c7 100644 --- a/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java +++ b/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java @@ -425,6 +425,7 @@ public class Session implements ISession { if (nodeUrls.isEmpty()) { throw new IllegalArgumentException("nodeUrls shouldn't be empty."); } + Collections.shuffle(nodeUrls); this.nodeUrls = nodeUrls; this.username = username; this.password = password; @@ -441,6 +442,7 @@ public class Session implements ISession { if (builder.nodeUrls.isEmpty()) { throw new IllegalArgumentException("nodeUrls shouldn't be empty."); } + Collections.shuffle(builder.nodeUrls); this.nodeUrls = builder.nodeUrls; this.enableQueryRedirection = true; } else {
