public static class BalancedShardsAllocator.Balancer
extends java.lang.Object
Constructor and Description |
---|
Balancer(ESLogger logger,
RoutingAllocation allocation,
BalancedShardsAllocator.WeightFunction weight,
float threshold) |
Modifier and Type | Method and Description |
---|---|
float |
avgShardsPerNode()
Returns the global average of shards per node
|
float |
avgShardsPerNode(java.lang.String index)
Returns the average of shards per node for the given index
|
boolean |
moveShards()
Move started shards that can not be allocated to a node anymore
For each shard to be moved this function executes a move operation
to the minimal eligible node with respect to the
weight function.
|
java.util.Map<DiscoveryNode,java.lang.Float> |
weighShard(ShardRouting shard) |
public Balancer(ESLogger logger, RoutingAllocation allocation, BalancedShardsAllocator.WeightFunction weight, float threshold)
public float avgShardsPerNode(java.lang.String index)
public float avgShardsPerNode()
public java.util.Map<DiscoveryNode,java.lang.Float> weighShard(ShardRouting shard)
public boolean moveShards()
ShardRoutingState.RELOCATING
and a shadow instance of this
shard is created with an incremented version in the state
ShardRoutingState.INITIALIZING
.true
if the allocation has changed, otherwise false