use of org.apache.solr.client.solrj.impl.BinaryResponseParser in project lucene-solr by apache.
the class SolrSchemalessExampleTest method createNewSolrClient.
@Override
public SolrClient createNewSolrClient() {
try {
// setup the server...
String url = jetty.getBaseUrl().toString() + "/collection1";
HttpSolrClient client = getHttpSolrClient(url);
client.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT);
client.setUseMultiPartPost(random().nextBoolean());
if (random().nextBoolean()) {
client.setParser(new BinaryResponseParser());
client.setRequestWriter(new BinaryRequestWriter());
}
return client;
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
use of org.apache.solr.client.solrj.impl.BinaryResponseParser in project lucene-solr by apache.
the class StreamingSolrClients method getSolrClient.
public synchronized SolrClient getSolrClient(final SolrCmdDistributor.Req req) {
String url = getFullUrl(req.node.getUrl());
ConcurrentUpdateSolrClient client = solrClients.get(url);
if (client == null) {
// NOTE: increasing to more than 1 threadCount for the client could cause updates to be reordered
// on a greater scale since the current behavior is to only increase the number of connections/Runners when
// the queue is more than half full.
client = new ErrorReportingConcurrentUpdateSolrClient(url, httpClient, 100, runnerCount, updateExecutor, true, req);
// minimize connections created
client.setPollQueueTime(Integer.MAX_VALUE);
client.setParser(new BinaryResponseParser());
client.setRequestWriter(new BinaryRequestWriter());
Set<String> queryParams = new HashSet<>(2);
queryParams.add(DistributedUpdateProcessor.DISTRIB_FROM);
queryParams.add(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM);
client.setQueryParams(queryParams);
solrClients.put(url, client);
}
return client;
}
Aggregations