Search in sources :

Example 1 with Builder

use of org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder in project lucene-solr by apache.

the class LBHttpSolrClientBuilderTest method testDefaultsToBinaryResponseParserWhenNoneProvided.

@Test
public void testDefaultsToBinaryResponseParserWhenNoneProvided() {
    try (LBHttpSolrClient createdClient = new Builder().withBaseSolrUrl(ANY_BASE_SOLR_URL).build()) {
        final ResponseParser usedParser = createdClient.getParser();
        assertTrue(usedParser instanceof BinaryResponseParser);
    }
}
Also used : ResponseParser(org.apache.solr.client.solrj.ResponseParser) Builder(org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder) HttpClientBuilder(org.apache.http.impl.client.HttpClientBuilder) Test(org.junit.Test)

Example 2 with Builder

use of org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder in project lucene-solr by apache.

the class HttpShardHandlerFactory method createLoadbalancer.

protected LBHttpSolrClient createLoadbalancer(HttpClient httpClient) {
    LBHttpSolrClient client = new Builder().withHttpClient(httpClient).build();
    client.setConnectionTimeout(connectionTimeout);
    client.setSoTimeout(soTimeout);
    return client;
}
Also used : Builder(org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder) LBHttpSolrClient(org.apache.solr.client.solrj.impl.LBHttpSolrClient)

Aggregations

Builder (org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder)2 HttpClientBuilder (org.apache.http.impl.client.HttpClientBuilder)1 ResponseParser (org.apache.solr.client.solrj.ResponseParser)1 LBHttpSolrClient (org.apache.solr.client.solrj.impl.LBHttpSolrClient)1 Test (org.junit.Test)1