Builder

io.ino.solrs.FastestServerLB.Builder
case class Builder(solrServers: SolrServers, collectionAndTestQuery: SolrServer => (String, SolrQuery), minDelay: Duration, maxDelay: Duration, initialTestRuns: Int, filterFastServers: Long => ((SolrServer, Long)) => Boolean, mapPredictedResponseTime: Long => Long, isUpdatesToLeaders: Boolean, clock: Clock)

Attributes

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

Members list

Value members

Concrete methods

def build(): FastestServerLB[[T <: <FromJavaObject>] =>> CompletionStage[T]]
def build[F[_]](implicit futureFactory: FutureFactory[F]): FastestServerLB[F]
def withClock(clock: Clock): Builder

The clock to get the current time from.

The clock to get the current time from.

Attributes

def withFilterFastServers(filter: LongFunction[BiFunction[SolrServer, Long, Boolean]]): Builder

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 accept some deviation, for smaller values like 1 or 2 millis also add some fix value to allow normal deviation).

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 accept some deviation, for smaller values like 1 or 2 millis also add some fix value to allow normal deviation).

Attributes

def withInitialTestRuns(count: Int): Builder

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

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

Attributes

def withMapPredictedResponseTime(mapPredictedResponseTime: Function[Long, Long]): Builder

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.

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.

Attributes

def withMaxDelay(value: Long, unit: TimeUnit): Builder

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

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

Attributes

def withMinDelay(value: Long, unit: TimeUnit): Builder

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

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

Attributes

def withUpdatesToLeaders(isUpdatesToLeaders: Boolean): Builder

If set to true, update requests will be sent to shard leaders if IsUpdateRequest.isSendToLeaders is true as well. Default is false

If set to true, update requests will be sent to shard leaders if IsUpdateRequest.isSendToLeaders is true as well. Default is false

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product