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

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1378922 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-08-30 13:18:29 +00:00
parent 1e573d0ea6
commit e31ddf3554
1 changed files with 5 additions and 3 deletions

View File

@ -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);