SOLR-5223: SolrCloud should use the JavaBin binary format for communication by default.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1533684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-10-19 03:24:08 +00:00
parent 457d1ac0c0
commit 3f289b737b
4 changed files with 22 additions and 1 deletions

View File

@ -114,6 +114,9 @@ Optimizations
* SOLR-5232: SolrCloud should distribute updates via streaming rather than buffering.
(Mark Miller)
* SOLR-5223: SolrCloud should use the JavaBin binary format for communication by default.
(Mark Miller)
Security
----------------------

View File

@ -83,7 +83,8 @@ public class StreamingSolrServers {
errors.add(error);
}
};
server.setParser(new BinaryResponseParser());
server.setRequestWriter(new BinaryRequestWriter());
server.setPollQueueTime(0);
solrServers.put(url, server);
}

View File

@ -44,6 +44,7 @@ import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.request.AbstractUpdateRequest;
import org.apache.solr.client.solrj.request.IsUpdateRequest;
import org.apache.solr.client.solrj.request.RequestWriter;
import org.apache.solr.client.solrj.request.UpdateRequest;
import org.apache.solr.client.solrj.util.ClientUtils;
import org.apache.solr.common.SolrException;
@ -122,6 +123,8 @@ public class CloudSolrServer extends SolrServer {
this.zkHost = zkHost;
this.myClient = HttpClientUtil.createClient(null);
this.lbServer = new LBHttpSolrServer(myClient);
this.lbServer.setRequestWriter(new BinaryRequestWriter());
this.lbServer.setParser(new BinaryResponseParser());
this.updatesToLeaders = true;
shutdownLBHttpSolrServer = true;
}
@ -131,6 +134,8 @@ public class CloudSolrServer extends SolrServer {
this.zkHost = zkHost;
this.myClient = HttpClientUtil.createClient(null);
this.lbServer = new LBHttpSolrServer(myClient);
this.lbServer.setRequestWriter(new BinaryRequestWriter());
this.lbServer.setParser(new BinaryResponseParser());
this.updatesToLeaders = updatesToLeaders;
shutdownLBHttpSolrServer = true;
}
@ -175,6 +180,14 @@ public class CloudSolrServer extends SolrServer {
public void setParser(ResponseParser processor) {
lbServer.setParser(processor);
}
public RequestWriter getRequestWriter() {
return lbServer.getRequestWriter();
}
public void setRequestWriter(RequestWriter requestWriter) {
lbServer.setRequestWriter(requestWriter);
}
public ZkStateReader getZkStateReader() {
return zkStateReader;

View File

@ -606,6 +606,10 @@ public class LBHttpSolrServer extends SolrServer {
this.requestWriter = requestWriter;
}
public RequestWriter getRequestWriter() {
return requestWriter;
}
@Override
protected void finalize() throws Throwable {
try {