Module org.elasticsearch.server
Record Class AutoShardingResult
java.lang.Object
java.lang.Record
org.elasticsearch.action.datastreams.autosharding.AutoShardingResult
public record AutoShardingResult(AutoShardingType type, int currentNumberOfShards, int targetNumberOfShards, TimeValue coolDownRemaining)
extends Record
Represents an auto sharding recommendation. It includes the current and target number of shards together with a remaining cooldown
period that needs to lapse before the current recommendation should be applied.
If auto sharding is not applicable for a data stream (e.g. due to
DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING) the target number of shards will be -1 and cool down
remaining TimeValue.MAX_VALUE.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAutoShardingResult(AutoShardingType type, int currentNumberOfShards, int targetNumberOfShards, TimeValue coolDownRemaining) Creates an instance of aAutoShardingResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecoolDownRemainingrecord component.intReturns the value of thecurrentNumberOfShardsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thetargetNumberOfShardsrecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
NOT_APPLICABLE_RESULT
-
-
Constructor Details
-
AutoShardingResult
public AutoShardingResult(AutoShardingType type, int currentNumberOfShards, int targetNumberOfShards, TimeValue coolDownRemaining) Creates an instance of aAutoShardingResultrecord class.- Parameters:
type- the value for thetyperecord componentcurrentNumberOfShards- the value for thecurrentNumberOfShardsrecord componenttargetNumberOfShards- the value for thetargetNumberOfShardsrecord componentcoolDownRemaining- the value for thecoolDownRemainingrecord 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 '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
currentNumberOfShards
public int currentNumberOfShards()Returns the value of thecurrentNumberOfShardsrecord component.- Returns:
- the value of the
currentNumberOfShardsrecord component
-
targetNumberOfShards
public int targetNumberOfShards()Returns the value of thetargetNumberOfShardsrecord component.- Returns:
- the value of the
targetNumberOfShardsrecord component
-
coolDownRemaining
Returns the value of thecoolDownRemainingrecord component.- Returns:
- the value of the
coolDownRemainingrecord component
-