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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanAddShardsrecord component.Returns the value of thecurrentUsedShardsrecord component.final booleanIndicates whether some other object is "equal to" this one.group()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxShardsInClusterrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalShardsToAddrecord component.
-
Constructor Details
-
Result
public Result(boolean canAddShards, Optional<Long> currentUsedShards, int totalShardsToAdd, int maxShardsInCluster, String group) Creates an instance of aResultrecord class.- Parameters:
canAddShards- the value for thecanAddShardsrecord componentcurrentUsedShards- the value for thecurrentUsedShardsrecord componenttotalShardsToAdd- the value for thetotalShardsToAddrecord componentmaxShardsInCluster- the value for themaxShardsInClusterrecord componentgroup- the value for thegrouprecord 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 thecanAddShardsrecord component.- Returns:
- the value of the
canAddShardsrecord component
-
currentUsedShards
Returns the value of thecurrentUsedShardsrecord component.- Returns:
- the value of the
currentUsedShardsrecord component
-
totalShardsToAdd
public int totalShardsToAdd()Returns the value of thetotalShardsToAddrecord component.- Returns:
- the value of the
totalShardsToAddrecord component
-
maxShardsInCluster
public int maxShardsInCluster()Returns the value of themaxShardsInClusterrecord component.- Returns:
- the value of the
maxShardsInClusterrecord component
-
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-