mirror of https://github.com/apache/lucene.git
SOLR-9784: Refactor CloudSolrClient to eliminate direct dependency on ZK
This commit is contained in:
parent
e309f90589
commit
8201ddc3b3
|
@ -1230,7 +1230,7 @@ public class CloudSolrClient extends SolrClient {
|
||||||
}
|
}
|
||||||
List<String> theUrlList = new ArrayList<>();
|
List<String> theUrlList = new ArrayList<>();
|
||||||
if (ADMIN_PATHS.contains(request.getPath())) {
|
if (ADMIN_PATHS.contains(request.getPath())) {
|
||||||
Set<String> liveNodes = getLiveNodes();
|
Set<String> liveNodes = stateProvider.liveNodes();
|
||||||
for (String liveNode : liveNodes) {
|
for (String liveNode : liveNodes) {
|
||||||
theUrlList.add(ZkStateReader.getBaseUrlForNodeName(liveNode,
|
theUrlList.add(ZkStateReader.getBaseUrlForNodeName(liveNode,
|
||||||
(String) stateProvider.getClusterProperties().getOrDefault(ZkStateReader.URL_SCHEME,"http")));
|
(String) stateProvider.getClusterProperties().getOrDefault(ZkStateReader.URL_SCHEME,"http")));
|
||||||
|
@ -1263,7 +1263,7 @@ public class CloudSolrClient extends SolrClient {
|
||||||
Collection<Slice> routeSlices = col.getRouter().getSearchSlices(shardKeys, reqParams , col);
|
Collection<Slice> routeSlices = col.getRouter().getSearchSlices(shardKeys, reqParams , col);
|
||||||
ClientUtils.addSlices(slices, collectionName, routeSlices, true);
|
ClientUtils.addSlices(slices, collectionName, routeSlices, true);
|
||||||
}
|
}
|
||||||
Set<String> liveNodes = getLiveNodes();
|
Set<String> liveNodes = stateProvider.liveNodes();
|
||||||
|
|
||||||
List<String> leaderUrlList = null;
|
List<String> leaderUrlList = null;
|
||||||
List<String> urlList = null;
|
List<String> urlList = null;
|
||||||
|
@ -1339,10 +1339,6 @@ public class CloudSolrClient extends SolrClient {
|
||||||
return rsp.getResponse();
|
return rsp.getResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<String> getLiveNodes() {
|
|
||||||
return getZkStateReader().getClusterState().getLiveNodes();
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<String> getCollectionNames(String collection) {
|
Set<String> getCollectionNames(String collection) {
|
||||||
// Extract each comma separated collection name and store in a List.
|
// Extract each comma separated collection name and store in a List.
|
||||||
List<String> rawCollectionsList = StrUtils.splitSmart(collection, ",", true);
|
List<String> rawCollectionsList = StrUtils.splitSmart(collection, ",", true);
|
||||||
|
|
Loading…
Reference in New Issue