Class BalancedShardsAllocator.NodeSorter

java.lang.Object
org.apache.lucene.util.Sorter
org.apache.lucene.util.IntroSorter
org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.NodeSorter
Enclosing class:
BalancedShardsAllocator

public static final class BalancedShardsAllocator.NodeSorter extends org.apache.lucene.util.IntroSorter
A NodeSorter sorts the set of nodes for a single partition using the WeightFunction for that partition. In partitioned cluster topologies there will be one for each partition (e.g. search/indexing in stateless). By default, there is a single partition containing a single weight function that applies to all nodes and shards.
See Also:
  • Constructor Details

  • Method Details

    • reset

      public void reset(org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.ProjectIndex index, int from, int to)
      Resets the sorter, recalculates the weights per node and sorts the nodes by weight, with minimal weight first.
    • reset

      public void reset(org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.ProjectIndex index)
    • weight

      public float weight(BalancedShardsAllocator.ModelNode node)
    • minWeightDelta

      public float minWeightDelta()
    • swap

      protected void swap(int i, int j)
      Specified by:
      swap in class org.apache.lucene.util.Sorter
    • compare

      protected int compare(int i, int j)
      Overrides:
      compare in class org.apache.lucene.util.IntroSorter
    • setPivot

      protected void setPivot(int i)
      Specified by:
      setPivot in class org.apache.lucene.util.IntroSorter
    • comparePivot

      protected int comparePivot(int j)
      Specified by:
      comparePivot in class org.apache.lucene.util.IntroSorter
    • delta

      public float delta()
    • getWeightFunction

      public WeightFunction getWeightFunction()