tflobbe commented on a change in pull request #974: [SOLR-13865] Migrate replica routing code to SolrJ URL: https://github.com/apache/lucene-solr/pull/974#discussion_r339784283
########## File path: solr/solrj/src/java/org/apache/solr/client/solrj/routing/NodePreferenceRulesComparator.java ########## @@ -0,0 +1,181 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.solr.client.solrj.routing; + +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; + +import org.apache.solr.common.StringUtils; +import org.apache.solr.common.cloud.NodesSysPropsCacher; +import org.apache.solr.common.cloud.Replica; +import org.apache.solr.common.params.ShardParams; +import org.apache.solr.common.params.SolrParams; + +/** + * A distributed request is made to the first live server in the URL list. + * This means it is just as likely to choose current host as any of the other hosts. + * This function makes sure that the cores 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". + */ Review comment: This needs to be updated ---------------------------------------------------------------- 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: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org