public static class BalancedShardsAllocator.WeightFunction extends Object
index balance
- balance property over shards per indexshard balance
- balance property over shards per clusterprimary balance
- balance property over primaries per clusterEach of these properties are expressed as factor such that the properties factor defines the relative importance of the property for the weight function. For example if the weight function should calculate the weights only based on a global (shard) balance the index and primary balance can be set to 0.0 and will in turn have no effect on the distribution.
The weight per index is calculated based on the following formula:weightindex(node, index) = indexBalance * (node.numShards(index) - avgShardsPerNode(index))
weightnode(node, index) = shardBalance * (node.numShards() - avgShardsPerNode)
weightprimary(node, index) = primaryBalance * (node.numPrimaries() - avgPrimariesPerNode)
weight(node, index) = weightindex(node, index) + weightnode(node, index) + weightprimary(node, index)
Constructor and Description |
---|
WeightFunction(float indexBalance,
float shardBalance,
float primaryBalance) |
Modifier and Type | Method and Description |
---|---|
float |
weight(BalancedShardsAllocator.Operation operation,
BalancedShardsAllocator.Balancer balancer,
org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.ModelNode node,
String index) |
public WeightFunction(float indexBalance, float shardBalance, float primaryBalance)
public float weight(BalancedShardsAllocator.Operation operation, BalancedShardsAllocator.Balancer balancer, org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.ModelNode node, String index)
Copyright © 2009–2015. All rights reserved.