Package org.apache.solr.core
Class CoreSorter
- java.lang.Object
-
- org.apache.solr.core.CoreSorter
-
- All Implemented Interfaces:
Comparator<CoreDescriptor>
public final class CoreSorter extends Object implements Comparator<CoreDescriptor>
This is a utility class that sorts cores in such a way as to minimize other cores waiting for replicas in the current node. This helps in avoiding leaderVote timeouts happening in other nodes of the cluster
-
-
Constructor Summary
Constructors Constructor Description CoreSorter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(CoreDescriptor cd1, CoreDescriptor cd2)
static List<CoreDescriptor>
sortCores(CoreContainer coreContainer, List<CoreDescriptor> descriptors)
Primary entry-point to sort the cores.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
sortCores
public static List<CoreDescriptor> sortCores(CoreContainer coreContainer, List<CoreDescriptor> descriptors)
Primary entry-point to sort the cores.
-
compare
public int compare(CoreDescriptor cd1, CoreDescriptor cd2)
- Specified by:
compare
in interfaceComparator<CoreDescriptor>
-
-