Module org.elasticsearch.server
Package org.elasticsearch.indices
Record Class ShardLimitValidator.Result
java.lang.Object
java.lang.Record
org.elasticsearch.indices.ShardLimitValidator.Result
- Enclosing class:
- ShardLimitValidator
public static record ShardLimitValidator.Result(boolean canAddShards, Optional<Long> currentUsedShards, int totalShardsToAdd, int maxShardsInCluster, String group)
extends Record
A Result object containing enough information to be used by external callers about the state of the cluster from the shard limits
perspective.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of thecanAddShards
record component.Returns the value of thecurrentUsedShards
record component.final boolean
Indicates whether some other object is "equal to" this one.group()
Returns the value of thegroup
record component.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of themaxShardsInCluster
record component.final String
toString()
Returns a string representation of this record class.int
Returns the value of thetotalShardsToAdd
record component.
-
Constructor Details
-
Result
public Result(boolean canAddShards, Optional<Long> currentUsedShards, int totalShardsToAdd, int maxShardsInCluster, String group) Creates an instance of aResult
record class.- Parameters:
canAddShards
- the value for thecanAddShards
record componentcurrentUsedShards
- the value for thecurrentUsedShards
record componenttotalShardsToAdd
- the value for thetotalShardsToAdd
record componentmaxShardsInCluster
- the value for themaxShardsInCluster
record componentgroup
- the value for thegroup
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
canAddShards
public boolean canAddShards()Returns the value of thecanAddShards
record component.- Returns:
- the value of the
canAddShards
record component
-
currentUsedShards
Returns the value of thecurrentUsedShards
record component.- Returns:
- the value of the
currentUsedShards
record component
-
totalShardsToAdd
public int totalShardsToAdd()Returns the value of thetotalShardsToAdd
record component.- Returns:
- the value of the
totalShardsToAdd
record component
-
maxShardsInCluster
public int maxShardsInCluster()Returns the value of themaxShardsInCluster
record component.- Returns:
- the value of the
maxShardsInCluster
record component
-
group
Returns the value of thegroup
record component.- Returns:
- the value of the
group
record component
-