public class ShardLimitValidator extends Object
This class contains the logic used to check the cluster-wide shard limit before shards are created and ensuring that the limit is updated correctly on setting updates, etc. NOTE: This is the limit applied at *shard creation time*. If you are looking for the limit applied at *allocation* time, which is controlled by a different setting, see
Method SummaryModifier and TypeMethodDescription
voidValidates whether a list of indices can be opened without going over the cluster shard limit.
voidChecks whether an index can be created without going over the cluster shard limit.
getShardLimitPerNodepublic int getShardLimitPerNode()
- the current value of the setting
validateShardLimitChecks whether an index can be created without going over the cluster shard limit.
settings- the settings of the index to be created
state- the current cluster state
ValidationException- if creating this index would put the cluster over the cluster shard limit
validateShardLimitValidates whether a list of indices can be opened without going over the cluster shard limit. Only counts indices which are currently closed and will be opened, ignores indices which are already open.
currentState- The current cluster state.
indicesToOpen- The indices which are to be opened.
ValidationException- If this operation would take the cluster over the limit and enforcement is enabled.