Class DiskThresholdDecider
- java.lang.Object
-
- org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
-
- org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider
-
public class DiskThresholdDecider extends AllocationDecider
TheDiskThresholdDecider
checks that the node a shard is potentially being allocated to has enough disk space. It has three configurable settings, all of which can be changed dynamically:cluster.routing.allocation.disk.watermark.low
is the low disk watermark. New shards will not allocated to a node with usage higher than this, although this watermark may be passed by allocating a shard. It defaults to 0.85 (85.0%).cluster.routing.allocation.disk.watermark.high
is the high disk watermark. If a node has usage higher than this, shards are not allowed to remain on the node. In addition, if allocating a shard to a node causes the node to pass this watermark, it will not be allowed. It defaults to 0.90 (90.0%). Both watermark settings are expressed in terms of used disk percentage, or exact byte values for free space (like "500mb")cluster.routing.allocation.disk.threshold_enabled
is used to enable or disable this decider. It defaults to false (disabled).
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
-
Constructor Summary
Constructors Constructor Description DiskThresholdDecider(Settings settings, ClusterSettings clusterSettings)
-
Method Summary
Modifier and Type Method Description Decision
canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be allocated on the given node.Decision
canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be remain on the given node.static long
getExpectedShardSize(ShardRouting shard, RoutingAllocation allocation, long defaultValue)
Returns the expected shard size for the given shard or the default value provided if not enough information are available to estimate the shards size.-
Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canAllocate, canAllocate, canForceAllocatePrimary, canRebalance, canRebalance
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DiskThresholdDecider
public DiskThresholdDecider(Settings settings, ClusterSettings clusterSettings)
-
-
Method Detail
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be allocated on the given node. The default isDecision.ALWAYS
.- Overrides:
canAllocate
in classAllocationDecider
-
canRemain
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be remain on the given node. The default isDecision.ALWAYS
.- Overrides:
canRemain
in classAllocationDecider
-
getExpectedShardSize
public static long getExpectedShardSize(ShardRouting shard, RoutingAllocation allocation, long defaultValue)
Returns the expected shard size for the given shard or the default value provided if not enough information are available to estimate the shards size.
-
-