diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java index c1d55bca689..8a37f8d3056 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java @@ -1230,7 +1230,7 @@ public class CloudSolrClient extends SolrClient { } List theUrlList = new ArrayList<>(); if (ADMIN_PATHS.contains(request.getPath())) { - Set liveNodes = getLiveNodes(); + Set liveNodes = stateProvider.liveNodes(); for (String liveNode : liveNodes) { theUrlList.add(ZkStateReader.getBaseUrlForNodeName(liveNode, (String) stateProvider.getClusterProperties().getOrDefault(ZkStateReader.URL_SCHEME,"http"))); @@ -1263,7 +1263,7 @@ public class CloudSolrClient extends SolrClient { Collection routeSlices = col.getRouter().getSearchSlices(shardKeys, reqParams , col); ClientUtils.addSlices(slices, collectionName, routeSlices, true); } - Set liveNodes = getLiveNodes(); + Set liveNodes = stateProvider.liveNodes(); List leaderUrlList = null; List urlList = null; @@ -1339,10 +1339,6 @@ public class CloudSolrClient extends SolrClient { return rsp.getResponse(); } - private Set getLiveNodes() { - return getZkStateReader().getClusterState().getLiveNodes(); - } - Set getCollectionNames(String collection) { // Extract each comma separated collection name and store in a List. List rawCollectionsList = StrUtils.splitSmart(collection, ",", true);