io.ino.solrs

package io.ino.solrs

Members list

Packages

Type members

Classlikes

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class AsyncSolrClient[F[_]]

Async, non-blocking Solr Client that allows to make requests to Solr. The usage shall be similar to the solrj SolrClient, so request returns a future of a SolrResponse.

Async, non-blocking Solr Client that allows to make requests to Solr. The usage shall be similar to the solrj SolrClient, so request returns a future of a SolrResponse.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait AsyncSolrClientAware[F[_]]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class CloudSolrServers[F]
class FastestServerLB[F]
class CloudSolrServers[F[_]](zkHost: String, zkClientTimeout: Duration, zkConnectTimeout: Duration, clusterStateUpdateInterval: Duration, defaultCollection: Option[String], warmupQueries: Option[WarmupQueries])(implicit futureFactory: FutureFactory[F]) extends SolrServers, AsyncSolrClientAware[F], ServerStateChangeObservable

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.

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.

Value parameters

clusterStateUpdateInterval

Used for pulling the ClusterState from ZkStateReader

defaultCollection

Optional default collection to use when the request does not specify the "collection" param.

zkClientTimeout

The zk session timeout (passed to ZkStateReader)

zkConnectTimeout

The zk connection timeout (passed to ZkStateReader), also used for ZkStateReader initialization attempt interval. Note that we're NOT stopping connection retries after connect timeout!

zkHost

The zkHost string, in $host:$port format, multiple hosts are specified comma separated

Attributes

Companion
object
Supertypes
trait SolrServers
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class CodaHaleMetrics[F[_]](val registry: MetricRegistry) extends Metrics

Attributes

Supertypes
trait Metrics
class Object
trait Matchable
class Any
case object Disabled extends ServerStatus

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ServerStatus
class Object
trait Matchable
class Any
Show all
Self type
Disabled.type
case object Enabled extends ServerStatus

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ServerStatus
class Object
trait Matchable
class Any
Show all
Self type
Enabled.type
case object Failed extends ServerStatus

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ServerStatus
class Object
trait Matchable
class Any
Show all
Self type
Failed.type
class FastestServerLB[F[_]](val solrServers: SolrServers, val collectionAndTestQuery: SolrServer => (String, SolrQuery), minDelay: Duration, maxDelay: Duration, initialTestRuns: Int, filterFastServers: Long => ((SolrServer, Long)) => Boolean, val mapPredictedResponseTime: Long => Long, isUpdatesToLeaders: Boolean, clock: Clock)(implicit futureFactory: FutureFactory[F]) extends LoadBalancer, AsyncSolrClientAware[F], FastestServerLBJmxSupport[F]

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.

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.

Value parameters

clock

the clock to get the current time from. The tests using the maxDelay are run using a scheduled executor, therefore this interval uses the system clock

collectionAndTestQuery

a function that returns the collection name and a testQuery for the given server. The collection is used to partition server when classifying "fast"/"slow" servers, because for different collections response times will be different. It's somehow similar with the testQuery: it might be different per server, e.g. some server might only provide a /suggest handler while others provide /select (which can be specified via the "qt" query param in the test query).

filterFastServers

a function to filter fast / preferred servers. The function takes the calculated average duration of all servers of a collection, and returns a function for a SolrServer->Duration tuple that returns true/false to indicate if a server should be considered "fast". The default value for filterFastServers uses duration <= average * 1.1 + 5 (use 1.1 as multiplier to accepted some deviation, for smaller values like 1 or 2 millis also add some fix value to allow normal deviation).

initialTestRuns

on start each active server is tested the given number of times to gather initial stats and determine fast/slow servers.

isUpdatesToLeaders

if set to true, updates are sent to shard leader if IsUpdateRequest.isSendToLeaders is true as well.

mapPredictedResponseTime

a function that's applied to the predicted response time. This can e.g. be used to quantize the time so that minor differences are ignored.

maxDelay

the delay between tests for slow servers (or all servers if there are no real requests)

minDelay

the minimum delay between the response of a test and the start of the next test (to limit test frequency)

solrServers

solr servers to load balance, those are regularly tested.

Attributes

Companion
object
Supertypes
trait LoadBalancer
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

JMX support for FastestServerLB, implementation of FastestServerLBMBean, to be mixed into FastestServerLB.

JMX support for FastestServerLB, implementation of FastestServerLBMBean, to be mixed into FastestServerLB.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class FastestServerLB[F]
Self type

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

JMX MBean for FastestServerLB.

JMX MBean for FastestServerLB.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class JavaAsyncSolrClient(val loadBalancer: LoadBalancer, httpClient: AsyncHttpClient, shutdownHttpClient: Boolean, requestInterceptor: Option[RequestInterceptor], requestWriter: RequestWriter, responseParser: ResponseParser, metrics: Metrics, serverStateObservation: Option[ServerStateObservation[[T <: <FromJavaObject>] =>> CompletionStage[T]]], retryPolicy: RetryPolicy) extends AsyncSolrClient[[T <: <FromJavaObject>] =>> CompletionStage[T]]

Java API: Async, non-blocking Solr Client that allows to make requests to Solr. The usage shall be similar to the solrj SolrClient, so request returns a CompletionStage of a SolrResponse.

Java API: Async, non-blocking Solr Client that allows to make requests to Solr. The usage shall be similar to the solrj SolrClient, 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"));

Attributes

Companion
object
Supertypes
class AsyncSolrClient[[T <: <FromJavaObject>] =>> CompletionStage[T]]
class Object
trait Matchable
class Any
object JavaAsyncSolrClient extends TypedAsyncSolrClient[[T <: <FromJavaObject>] =>> CompletionStage[T], JavaAsyncSolrClient]

Attributes

Companion
class
Supertypes
trait TypedAsyncSolrClient[[T <: <FromJavaObject>] =>> CompletionStage[T], JavaAsyncSolrClient]
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object LoadBalancer

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait Metrics

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class CodaHaleMetrics[F]
object NoopMetrics.type
object NoopMetrics extends Metrics

Attributes

Supertypes
trait Metrics
class Object
trait Matchable
class Any
Self type
class PerformanceStats(val solrServer: SolrServer, initialPredictedResponseTime: Long, clock: Clock)

Statistics for a solr server.

Statistics for a solr server.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class PingStatusObserver[F[_]](solrServers: SolrServers, httpClient: AsyncHttpClient)(implicit futureFactory: FutureFactory[F]) extends ServerStateObserver[F]

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.:

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>

Attributes

Supertypes
class Object
trait Matchable
class Any
class ReloadingSolrServers[F[_]](url: String, extractor: Array[Byte] => IndexedSeq[SolrServer], httpClient: AsyncHttpClient)(implicit futureFactory: FutureFactory[F]) extends SolrServers

Attributes

Supertypes
trait SolrServers
class Object
trait Matchable
class Any
class RemoteSolrException(code: Int, msg: String, th: Throwable) extends SolrException

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.

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.

Value parameters

code

Arbitrary HTTP status code

msg

Exception Message

th

Throwable to wrap with this Exception

Attributes

Supertypes
class SolrException
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
case class RequestContext[T <: SolrResponse](r: SolrRequest[_ <: T], preferred: Option[SolrServer], failedRequests: Seq[RequestInfo])

Defines the context for a request initiated by the client.

Defines the context for a request initiated by the client.

Value parameters

failedRequests

information regarding failed requests

preferred

the server that the user would like to use for the request

r

the request

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class RequestInfo(server: SolrServer, duration: Duration, exception: Throwable)

Information about a failed request.

Information about a failed request.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Clients can intercept requests.

Clients can intercept requests.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
sealed trait RetryDecision

A retry decision to adopt on a failed request.

A retry decision to adopt on a failed request.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object RetryDecision

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
abstract class RetryPolicy

Specifies a policy for retrying request failures.

Specifies a policy for retrying request failures.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object RetryPolicy

Predefined request retry policies.

Predefined request retry policies.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
case class RetryServer(server: SolrServer) extends RetryDecision

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
class RoundRobinLB(val solrServers: SolrServers, isUpdatesToLeaders: Boolean) extends LoadBalancer

Attributes

Companion
object
Supertypes
trait LoadBalancer
class Object
trait Matchable
class Any
object RoundRobinLB

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class CloudSolrServers[F]

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class ServerStateObservation[F[_]](serverStateObserver: ServerStateObserver[F], checkInterval: FiniteDuration, executorService: ScheduledExecutorService, futureFactory: FutureFactory[F])

Configuration for scheduled server state observation.

Configuration for scheduled server state observation.

Value parameters

checkInterval

the interval to check server state

executorService

the scheduler used to poll for state changes

futureFactory

factory to create promise/future types.

serverStateObserver

the observer that checks server state

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait ServerStateObserver[F[_]]

Monitoring of solr server state (enabled/disabled/dead etc.)

Monitoring of solr server state (enabled/disabled/dead etc.)

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
sealed trait ServerStatus

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Disabled.type
object Enabled.type
object Failed.type
class ShardReplica(baseUrl: String, underlying: Replica) extends SolrServer

Attributes

Companion
object
Supertypes
class SolrServer
class Object
trait Matchable
class Any
object ShardReplica

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class SingleServerLB(val server: SolrServer) extends LoadBalancer

Attributes

Supertypes
trait LoadBalancer
class Object
trait Matchable
class Any
trait SolrResponseFactory[T <: SolrResponse]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
class SolrServer(val baseUrl: String)

Represents a solr host, for a SolrCloud setup there's the specialized ShardReplica.

Represents a solr host, for a SolrCloud setup there's the specialized ShardReplica.

Value parameters

baseUrl

the solr server's base url, must not end with a slash.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ShardReplica
object SolrServer

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
SolrServer.type
final case class SolrServerId(url: String) extends AnyVal

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
trait SolrServers

Provides the list of solr servers.

Provides the list of solr servers.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class StandardRetryDecision(result: Result) extends RetryDecision

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
class StaticSolrServers(val all: IndexedSeq[SolrServer]) extends SolrServers

Attributes

Companion
object
Supertypes
trait SolrServers
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
trait TypedAsyncSolrClient[F[_], ASC <: AsyncSolrClient[F]]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object JavaAsyncSolrClient.type
object Utils

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Utils.type