You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2016/11/24 19:40:31 UTC
lucene-solr:branch_6x: SOLR-9784: Refactor CloudSolrClient to
eliminate direct dependency on ZK
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6x e309f9058 -> 8201ddc3b
SOLR-9784: Refactor CloudSolrClient to eliminate direct dependency on ZK
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8201ddc3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8201ddc3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8201ddc3
Branch: refs/heads/branch_6x
Commit: 8201ddc3b39adaad18ba0fc369d5383dbdb8926e
Parents: e309f90
Author: Noble Paul <no...@apache.org>
Authored: Fri Nov 25 01:10:14 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Fri Nov 25 01:10:14 2016 +0530
----------------------------------------------------------------------
.../org/apache/solr/client/solrj/impl/CloudSolrClient.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8201ddc3/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
----------------------------------------------------------------------
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 c1d55bc..8a37f8d 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<String> theUrlList = new ArrayList<>();
if (ADMIN_PATHS.contains(request.getPath())) {
- Set<String> liveNodes = getLiveNodes();
+ Set<String> 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<Slice> routeSlices = col.getRouter().getSearchSlices(shardKeys, reqParams , col);
ClientUtils.addSlices(slices, collectionName, routeSlices, true);
}
- Set<String> liveNodes = getLiveNodes();
+ Set<String> liveNodes = stateProvider.liveNodes();
List<String> leaderUrlList = null;
List<String> urlList = null;
@@ -1339,10 +1339,6 @@ public class CloudSolrClient extends SolrClient {
return rsp.getResponse();
}
- private Set<String> getLiveNodes() {
- return getZkStateReader().getClusterState().getLiveNodes();
- }
-
Set<String> getCollectionNames(String collection) {
// Extract each comma separated collection name and store in a List.
List<String> rawCollectionsList = StrUtils.splitSmart(collection, ",", true);