Class AffinityReplicaListTransformer
- java.lang.Object
-
- org.apache.solr.client.solrj.routing.AffinityReplicaListTransformer
-
- All Implemented Interfaces:
ReplicaListTransformer
public class AffinityReplicaListTransformer extends Object implements 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReplicaListTransformergetInstance(String dividendParam, String hashParam, SolrParams requestParams)<T> voidtransform(List<T> choices)Transforms the passed in list of choices.
-
-
-
Method Detail
-
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
public <T> void transform(List<T> choices)
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.
-
-