Skip to content

Commit

Permalink
HBASE-28500 Rest Java client library assumes stateless servers (Adden…
Browse files Browse the repository at this point in the history
…dum:fix spotbugs warning) (#5831)
  • Loading branch information
stoty authored Apr 17, 2024
1 parent 16e9aff commit d7f9ba6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadLocalRandom;
import javax.net.ssl.SSLContext;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
Expand Down Expand Up @@ -270,7 +271,7 @@ public HttpResponse executePathOnly(Cluster cluster, HttpUriRequest method, Head
throw new IOException("Cluster is empty");
}
if (lastNodeId == null || !sticky) {
lastNodeId = (int) (cluster.nodes.size() * Math.random());
lastNodeId = ThreadLocalRandom.current().nextInt(cluster.nodes.size());
}
int start = lastNodeId;
do {
Expand Down

0 comments on commit d7f9ba6

Please sign in to comment.