File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1296,19 +1296,19 @@ public void switchDataNode(Node node) throws IOException{
12961296 isConnected = true ;
12971297 break ;
12981298 }
1299- }
1300-
1301- if (nodes_ .isEmpty ()){
1302- log .error ("Connect to " + node .hostName + ":" + node .port + " failed." );
1303- throw new RuntimeException ("Connect to " + node .hostName + ":" + node .port + " failed." );
1304- }
1299+ } else {
1300+ if (nodes_ .isEmpty ()){
1301+ log .error ("Connect to " + node .hostName + ":" + node .port + " failed." );
1302+ throw new RuntimeException ("Connect to " + node .hostName + ":" + node .port + " failed." );
1303+ }
13051304
1306- int index = nodeRandom_ .nextInt (nodes_ .size ());
1307- if (connectNode (nodes_ .get (index ))) {
1308- if (nodes_ .size () > 1 )
1309- log .info ("Switch to node: " + nodes_ .get (index ).hostName + ":" + nodes_ .get (index ).port + " successfully." );
1310- isConnected = true ;
1311- break ;
1305+ int index = nodeRandom_ .nextInt (nodes_ .size ());
1306+ if (connectNode (nodes_ .get (index ))) {
1307+ if (nodes_ .size () > 1 )
1308+ log .info ("Switch to node: " + nodes_ .get (index ).hostName + ":" + nodes_ .get (index ).port + " successfully." );
1309+ isConnected = true ;
1310+ break ;
1311+ }
13121312 }
13131313
13141314 try {
You can’t perform that action at this time.
0 commit comments