Skip to content

Commit 48b3143

Browse files
author
chengyitian
committed
AJ-832: fix issue about connect when not enable 'enableClientAuth';
1 parent a79eac1 commit 48b3143

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/com/xxdb/DBConnection.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,11 @@ public boolean connect(String hostName, int port, String userId, String password
869869
}
870870

871871
try {
872-
bt = (BasicTable) conn_.run("getClusterPerf", new ArrayList<>(), 0);
872+
BasicBoolean isClientAuth = (BasicBoolean) conn_.run("isClientAuth", new ArrayList<>(), 0);
873+
if (isClientAuth.getBoolean())
874+
bt = (BasicTable) conn_.run("getClusterPerf", new ArrayList<>(), 0);
875+
else
876+
bt = (BasicTable) conn_.run("rpc(getControllerAlias(),getClusterPerf)", 0);
873877
break;
874878
} catch (Exception e) {
875879
log.error("ERROR getting other data nodes, exception: " + e.getMessage());
@@ -907,7 +911,7 @@ public boolean connect(String hostName, int port, String userId, String password
907911
} else {
908912
// enable loadBalance
909913
//ignore very high load nodes, rand one in low load nodes
910-
List<Node> lowLoadNodes=new ArrayList<>();
914+
List<Node> lowLoadNodes = new ArrayList<>();
911915
BasicIntVector mode = (BasicIntVector) bt.getColumn("mode");
912916
BasicStringVector colHost = (BasicStringVector) bt.getColumn("host");
913917
BasicIntVector colPort = (BasicIntVector) bt.getColumn("port");

0 commit comments

Comments
 (0)