Class AffinityReplicaListTransformerFactory
- java.lang.Object
-
- org.apache.solr.client.solrj.routing.AffinityReplicaListTransformerFactory
-
- All Implemented Interfaces:
ReplicaListTransformerFactory
public class AffinityReplicaListTransformerFactory extends Object implements ReplicaListTransformerFactory
Factory for constructing anAffinityReplicaListTransformer
that reorders replica routing preferences deterministically, based on request parameters.Default names of params that contain the values by which routing is determined may be configured at the time of
AffinityReplicaListTransformerFactory
construction, and may be overridden by the config spec passed togetInstance(String, SolrParams, ReplicaListTransformerFactory)
If no defaultHashParam name is specified at time of factory construction, the routing dividend will be derived by hashing the
String
value of theCommonParams.Q
param.
-
-
Constructor Summary
Constructors Constructor Description AffinityReplicaListTransformerFactory()
AffinityReplicaListTransformerFactory(String defaultDividendParam, String defaultHashParam)
AffinityReplicaListTransformerFactory(NamedList<?> c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReplicaListTransformer
getInstance(String configSpec, SolrParams requestParams, ReplicaListTransformerFactory fallback)
-
-
-
Constructor Detail
-
AffinityReplicaListTransformerFactory
public AffinityReplicaListTransformerFactory()
-
AffinityReplicaListTransformerFactory
public AffinityReplicaListTransformerFactory(String defaultDividendParam, String defaultHashParam)
-
AffinityReplicaListTransformerFactory
public AffinityReplicaListTransformerFactory(NamedList<?> c)
-
-
Method Detail
-
getInstance
public ReplicaListTransformer getInstance(String configSpec, SolrParams requestParams, ReplicaListTransformerFactory fallback)
- Specified by:
getInstance
in interfaceReplicaListTransformerFactory
- Parameters:
configSpec
- spec for dynamic configuration of ReplicaListTransformerrequestParams
- the request parameters for which the ReplicaListTransformer is being generatedfallback
- used to generate fallback value; the getInstance() method of the specified fallback must not return null; The fallback value itself may be null if this implementation is known to never return null (i.e., if fallback will never be needed)- Returns:
- ReplicaListTransformer to be used for routing this request
-
-