Example usage for org.apache.solr.client.solrj.impl HttpClientUtil PROP_USE_RETRY

List of usage examples for org.apache.solr.client.solrj.impl HttpClientUtil PROP_USE_RETRY

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj.impl HttpClientUtil PROP_USE_RETRY.

Prototype

String PROP_USE_RETRY

To view the source code for org.apache.solr.client.solrj.impl HttpClientUtil PROP_USE_RETRY.

Click Source Link

Usage

From source file:com.mustardgrain.solr.SolrClient.java

License:Apache License

/** The provided httpClient should use a multi-threaded connection manager */
public SolrClient(HttpClient httpClient, ResponseParser parser, String... solrServerUrl)
        throws MalformedURLException {
    clientIsInternal = (httpClient == null);
    this.parser = parser;
    if (httpClient == null) {
        ModifiableSolrParams params = new ModifiableSolrParams();
        params.set(HttpClientUtil.PROP_USE_RETRY, false);
        this.httpClient = HttpClientUtil.createClient(params);
    } else {/*from   www  . j  a  v  a 2  s .c  o  m*/
        this.httpClient = httpClient;
    }
    for (String s : solrServerUrl) {
        ServerWrapper wrapper = new ServerWrapper(makeServer(s));
        aliveServers.put(wrapper.getKey(), wrapper);
        serverStats.put(wrapper.getKey(), new SolrStats());
    }
    updateAliveList();
    startStatsExecutor();
    registerMBean();
}

From source file:org.opencommercesearch.lucene.queries.function.valuesource.BoostValueSourceParser.java

License:Apache License

@Override
public void init(NamedList args) {
    boostLimit = getParameter(args, BOOST_LIMIT, boostLimit);
    boostApiHost = getParameter(args, BOOST_API_HOST, boostApiHost);
    soTimeout = getParameter(args, HttpClientUtil.PROP_SO_TIMEOUT, soTimeout);
    connectionTimeout = getParameter(args, HttpClientUtil.PROP_CONNECTION_TIMEOUT, connectionTimeout);
    maxConnections = getParameter(args, HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, maxConnections);
    maxConnectionsPerHost = getParameter(args, HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST,
            maxConnectionsPerHost);//ww w . j  a  v  a2  s .c  o m

    ModifiableSolrParams clientParams = new ModifiableSolrParams();

    clientParams.set(HttpClientUtil.PROP_MAX_CONNECTIONS, maxConnections);
    clientParams.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, maxConnectionsPerHost);
    clientParams.set(HttpClientUtil.PROP_MAX_CONNECTIONS, maxConnections);
    clientParams.set(HttpClientUtil.PROP_SO_TIMEOUT, soTimeout);
    clientParams.set(HttpClientUtil.PROP_CONNECTION_TIMEOUT, connectionTimeout);
    clientParams.set(HttpClientUtil.PROP_USE_RETRY, false);
    defaultClient = HttpClientUtil.createClient(clientParams);
}