Class NodePreferenceRulesComparator
- java.lang.Object
- 
- org.apache.solr.client.solrj.routing.NodePreferenceRulesComparator
 
- 
- All Implemented Interfaces:
- Comparator<Object>
 
 public class NodePreferenceRulesComparator extends Object implements Comparator<Object> This comparator makes sure that the given replicas are sorted according to the given list of preferences. E.g. If all nodes prefer local cores then a bad/heavily-loaded node will receive less requests from healthy nodes. This will help prevent a distributed deadlock or timeouts in all the healthy nodes due to one bad node.Optional final preferenceRule is *not* used for pairwise sorting, but instead defines how "equivalent" replicas will be ordered (the base ordering). Defaults to "random"; may specify "stable". 
- 
- 
Constructor SummaryConstructors Constructor Description NodePreferenceRulesComparator(List<PreferenceRule> preferenceRules, SolrParams requestParams, String nodeName, String localHostAddress, NodesSysProps sysProps, ReplicaListTransformerFactory defaultRltFactory, ReplicaListTransformerFactory stableRltFactory)NodePreferenceRulesComparator(List<PreferenceRule> preferenceRules, SolrParams requestParams, ReplicaListTransformerFactory defaultRltFactory, ReplicaListTransformerFactory stableRltFactory)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Object left, Object right)ReplicaListTransformergetBaseReplicaListTransformer()List<PreferenceRule>getPreferenceRules()List<PreferenceRule>getSortRules()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.util.Comparatorequals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
 
- 
 
- 
- 
- 
Constructor Detail- 
NodePreferenceRulesComparatorpublic NodePreferenceRulesComparator(List<PreferenceRule> preferenceRules, SolrParams requestParams, ReplicaListTransformerFactory defaultRltFactory, ReplicaListTransformerFactory stableRltFactory) 
 - 
NodePreferenceRulesComparatorpublic NodePreferenceRulesComparator(List<PreferenceRule> preferenceRules, SolrParams requestParams, String nodeName, String localHostAddress, NodesSysProps sysProps, ReplicaListTransformerFactory defaultRltFactory, ReplicaListTransformerFactory stableRltFactory) 
 
- 
 - 
Method Detail- 
getBaseReplicaListTransformerpublic ReplicaListTransformer getBaseReplicaListTransformer() 
 - 
comparepublic int compare(Object left, Object right) - Specified by:
- comparein interface- Comparator<Object>
 
 - 
getSortRulespublic List<PreferenceRule> getSortRules() 
 - 
getPreferenceRulespublic List<PreferenceRule> getPreferenceRules() 
 
- 
 
-