Class AffinityReplicaListTransformer
java.lang.Object
org.apache.solr.client.solrj.routing.AffinityReplicaListTransformer
- All Implemented Interfaces:
ReplicaListTransformer
Allows better caching by establishing deterministic evenly-distributed replica routing
preferences according to either explicitly configured hash routing parameter, or the hash of a
query parameter (configurable, usually related to the main query).
-
Method Summary
Modifier and TypeMethodDescriptionstatic ReplicaListTransformergetInstance(String dividendParam, String hashParam, SolrParams requestParams) <T> voidTransforms the passed in list of choices.
-
Method Details
-
getInstance
public static ReplicaListTransformer getInstance(String dividendParam, String hashParam, SolrParams requestParams) - Parameters:
dividendParam- int param to be used directly for mod-based routinghashParam- String param to be hashed into an int for mod-based routingrequestParams- the parameters of the Solr request- Returns:
- null if specified routing vals are not able to be parsed properly
-
transform
Description copied from interface:ReplicaListTransformerTransforms the passed in list of choices. Transformations can include (but are not limited to) reordering of elements (e.g. via shuffling) and removal of elements (i.e. filtering).- Specified by:
transformin interfaceReplicaListTransformer- Parameters:
choices- - a list of choices to transform, typically the choices areReplicaobjects but choices can also beStringobjects such as URLs passed in via theShardParams.SHARDSparameter.
-