Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

use sendToLeaders rather than replicas != null to determine if we add repicas to end of the list

Mark Robert Millere31ddf355466
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
index 1bfdf74d79f..79bfb1f0b71 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
@@ -242,14 +242,16 @@ public class CloudSolrServer extends SolrServer {
theUrlList.addAll(urlList);
}
Collections.shuffle(theUrlList, rand);
- if (replicas != null) {
+ if (sendToLeaders) {
ArrayList<String> theReplicas = new ArrayList<String>(replicasList.size());
theReplicas.addAll(replicasList);
Collections.shuffle(theReplicas, rand);
-
+ // System.out.println("leaders:" + theUrlList);
+ // System.out.println("replicas:" + theReplicas);
theUrlList.addAll(theReplicas);
}
- //System.out.println("########################## MAKING REQUEST TO " + theUrlList);
+
+ // System.out.println("########################## MAKING REQUEST TO " + theUrlList);
LBHttpSolrServer.Req req = new LBHttpSolrServer.Req(request, theUrlList);
LBHttpSolrServer.Rsp rsp = lbServer.request(req);