tflobbe 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_r303695087
##########
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:
Ah, right, because the affinity just sets the rotation. But does it have to
be? What's the difference between doing a rotations vs a shuffle with a seed?
like:
`Collections.shuffle(replicas, new Random(hashValue));`
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]