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 an
AffinityReplicaListTransformer 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 to getInstance(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 the CommonParams.Q param.
-
Constructor Summary
ConstructorsConstructorDescriptionAffinityReplicaListTransformerFactory(String defaultDividendParam, String defaultHashParam) -
Method Summary
Modifier and TypeMethodDescriptiongetInstance(String configSpec, SolrParams requestParams, ReplicaListTransformerFactory fallback)
-
Constructor Details
-
AffinityReplicaListTransformerFactory
public AffinityReplicaListTransformerFactory() -
AffinityReplicaListTransformerFactory
-
AffinityReplicaListTransformerFactory
-
-
Method Details
-
getInstance
public ReplicaListTransformer getInstance(String configSpec, SolrParams requestParams, ReplicaListTransformerFactory fallback) - Specified by:
getInstancein 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
-