magibney commented on a change in pull request #677: SOLR-13257: support for stable replica routing preferences URL: https://github.com/apache/lucene-solr/pull/677#discussion_r305150693
########## File path: solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java ########## @@ -449,9 +556,83 @@ private static boolean hasReplicaType(Object o, String preferred) { } } + private final ReplicaListTransformerFactory randomRltFactory = (String configSpec, SolrQueryRequest request, + ReplicaListTransformerFactory fallback) -> shufflingReplicaListTransformer; + private ReplicaListTransformerFactory stableRltFactory; + private ReplicaListTransformerFactory defaultRltFactory; + + /** + * Private class responsible for applying pairwise sort based on inherent replica attributes, + * and subsequently reordering any equivalent replica sets according to behavior specified + * by the baseReplicaListTransformer. + */ + private static final class TopLevelReplicaListTransformer implements ReplicaListTransformer { + + private final NodePreferenceRulesComparator replicaComp; + private final ReplicaListTransformer baseReplicaListTransformer; + + public TopLevelReplicaListTransformer(NodePreferenceRulesComparator replicaComp, ReplicaListTransformer baseReplicaListTransformer) { + this.replicaComp = replicaComp; + this.baseReplicaListTransformer = baseReplicaListTransformer; + } + + @Override + public void transform(List<?> choices) { Review comment: >make sure those two users get different affinity, right? vs with shuffle-with-seed, they could end up in the same nodes? Exactly, yes; that's the idea. Thanks! ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org