public class DiskThresholdDecider extends AllocationDecider
DiskThresholdDecider 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).| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
deprecationLogger, logger, settings| Constructor and Description |
|---|
DiskThresholdDecider(Settings settings,
ClusterSettings clusterSettings) |
| Modifier and Type | Method and Description |
|---|---|
Decision |
canAllocate(ShardRouting shardRouting,
RoutingNode node,
RoutingAllocation allocation)
Returns a
Decision whether the given shard routing can be
allocated on the given node. |
Decision |
canRemain(ShardRouting shardRouting,
RoutingNode node,
RoutingAllocation allocation)
Returns a
Decision 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.
|
canAllocate, canAllocate, canAllocate, canForceAllocatePrimary, canRebalance, canRebalancelogDeprecatedSetting, logRemovedSetting, nodeNamepublic static final java.lang.String NAME
public DiskThresholdDecider(Settings settings, ClusterSettings clusterSettings)
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
AllocationDeciderDecision whether the given shard routing can be
allocated on the given node. The default is Decision.ALWAYS.canAllocate in class AllocationDeciderpublic Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
AllocationDeciderDecision whether the given shard routing can be remain
on the given node. The default is Decision.ALWAYS.canRemain in class AllocationDeciderpublic static long getExpectedShardSize(ShardRouting shard, RoutingAllocation allocation, long defaultValue)