Module org.elasticsearch.server
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:
- Shards with write-load in
threshold→maxWriteLoadOnNode(exclusive) - Shards with write-load in
threshold→ 0 - Shards with write-load ==
maxWriteLoadOnNode - Shards with missing write-load
ShardRoutings, r1 and r2,
compare(r1, r2) > 0whenr2is more desirable to movecompare(r1, r2) == 0when the two shards are equally desirable to movecompare(r1, r2) < 0whenr1is more desirable to move
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThis 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. -
Constructor Summary
ConstructorsConstructorDescriptionPrioritiseByShardWriteLoadComparator(ClusterInfo clusterInfo, RoutingNode routingNode) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
THRESHOLD_RATIO
public static final double THRESHOLD_RATIOThis 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
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<ShardRouting>
-