We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df5744f commit 26202c6Copy full SHA for 26202c6
1 file changed
src/com/xxdb/DBConnection.java
@@ -1303,13 +1303,12 @@ public void switchDataNode(Node node) throws IOException{
1303
throw new RuntimeException("Connect to " + node.hostName + ":" + node.port + " failed.");
1304
}
1305
1306
- if (nodes_.size() > 1) {
1307
- int index = nodeRandom_.nextInt(nodes_.size());
1308
- if (connectNode(nodes_.get(index))){
+ int index = nodeRandom_.nextInt(nodes_.size());
+ if (connectNode(nodes_.get(index))) {
+ if (nodes_.size() > 1)
1309
log.info("Switch to node: " + nodes_.get(index).hostName + ":" + nodes_.get(index).port + " successfully.");
1310
- isConnected = true;
1311
- break;
1312
- }
+ isConnected = true;
+ break;
1313
1314
1315
try {
0 commit comments