Async, non-blocking Solr Server that allows to make requests to Solr.
Provides servers based on information from from ZooKeeper.
Provides servers based on information from from ZooKeeper. Uses the ZkStateReader to read the ZK cluster state, which is also used by solrj's CloudSolrServer. While ZkStateReader uses ZK Watches to get cluster state changes from ZK, we're regularly updating our internal state by reading the cluster state from ZkStateReader.
LB strategy that selects the fastest server based on the latest average response time.
LB strategy that selects the fastest server based on the latest average response time. It's aimed to handle a multi datacenter setup where some server regularly need longer to response. It shall also detect short (subsecond) pauses of a server e.g. due to garbage collection or s.th. else.
The latest average response time is determined in the following order (the first found measure is used): - currently still running requests (if they're lasting longer than previous, already completed requests) - average response time of the current or the last second - average response time of the last ten seconds - total average resonse time
The response time is measured using the given testQuery. A dedicated test query is used, because queries can have very different performance characteristics, so that it might even be hard for an application to classify this. With the testQuery you have control what is used to measure response time.
For "normal" / "fast" servers (default: with a resonse time <= the average of all servers, you can override
determineFastServers
) test queries are run whenever a request comes in, but between test queries at least
the minDelay has to be passed.
This way servers are not hammered with requests when nobody else is using your search, but if there's
high traffic this load balancer get high resolution of monitoring data to detect short pauses as well.
For "slow" servers (default: response time > average) tests are run using the specified maxDelay.
Directly after creation of this LoadBalancer / AsnycSolrClient multiple test queries are run (according
to the specified initialTestRuns
, by default 10) to have initial stats.
JMX support for FastestServerLB, implementation of FastestServerLBMBean, to be mixed into FastestServerLB.
JMX MBean for FastestServerLB.
Java API: Async, non-blocking Solr Server that allows to make requests to Solr.
Java API: Async, non-blocking Solr Server that allows to make requests to Solr. The usage shall be similar to the solrj SolrServer, so request returns a CompletionStage of a SolrResponse.
Example usage:
JavaAsyncSolrClient solr = JavaAsyncSolrClient.create("http://localhost:" + solrRunner.port + "/solr/collection1"); CompletionStage<QueryResponse> response = solr.query(new SolrQuery("*:*")); response.thenAccept(r -> System.out.println("found "+ r.getResults().getNumFound() +" docs"));
Statistics for a solr server.
A ServerStateObserver that uses the ping status to enable/disable SolrServers.
A ServerStateObserver that uses the ping status to enable/disable SolrServers.
To use this in solrconfig.xml the PingRequestHandler must be configured with the
healthcheckFile, e.g.:
<str name="healthcheckFile">server-enabled.txt</str>
Subclass of SolrException that allows us to capture an arbitrary HTTP status code that may have been returned by the remote server or a proxy along the way.
Defines the context for a request initiated by the client.
Defines the context for a request initiated by the client.
the request
the server that the user would like to use for the request
information regarding failed requests
Information about a failed request.
Clients can intercept requests.
A retry decision to adopt on a failed request.
Specifies a policy for retrying request failures.
Configuration for scheduled server state observation.
Configuration for scheduled server state observation.
the observer that checks server state
the interval to check server state
used for scheduling
factory to create promise/future types.
Monitoring of solr server state (enabled/disabled/dead etc.)
Represents a solr host.
Provides the list of solr servers.
Created by magro on 9/12/14.
Predefined request retry policies.
Async, non-blocking Solr Server that allows to make requests to Solr. The usage shall be similar to the solrj SolrServer, so request returns a future of a
SolrResponse
.