Class BalancedShardsAllocator.Balancer.PrioritiseByShardWriteLoadComparator

java.lang.Object
org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.Balancer.PrioritiseByShardWriteLoadComparator
All Implemented Interfaces:
Comparator<ShardRouting>
Enclosing class:
BalancedShardsAllocator.Balancer

public static class BalancedShardsAllocator.Balancer.PrioritiseByShardWriteLoadComparator extends Object implements Comparator<ShardRouting>
Sorts shards by desirability to move, sort order goes:
  1. Shards with write-load in thresholdmaxWriteLoadOnNode (exclusive)
  2. Shards with write-load in threshold → 0
  3. Shards with write-load == maxWriteLoadOnNode
  4. Shards with missing write-load
e.g., for any two ShardRoutings, r1 and r2,
  • compare(r1, r2) > 0 when r2 is more desirable to move
  • compare(r1, r2) == 0 when the two shards are equally desirable to move
  • compare(r1, r2) < 0 when r1 is more desirable to move
  • Field Details

    • THRESHOLD_RATIO

      public static final double THRESHOLD_RATIO
      This is the threshold over which we consider shards to have a "high" write load represented as a ratio of the maximum write-load present on the node.

      We prefer to move shards that have a write-load close to this value x maxWriteLoadOnNode.

      See Also:
  • Constructor Details

    • PrioritiseByShardWriteLoadComparator

      public PrioritiseByShardWriteLoadComparator(ClusterInfo clusterInfo, RoutingNode routingNode)
  • Method Details