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, Double writeLoad)
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, Double writeLoad) Creates an instance of aAutoShardingResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecoolDownRemaining
record component.int
Returns the value of thecurrentNumberOfShards
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thetargetNumberOfShards
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.Returns the value of thewriteLoad
record component.
-
Field Details
-
NOT_APPLICABLE_RESULT
-
-
Constructor Details
-
AutoShardingResult
public AutoShardingResult(AutoShardingType type, int currentNumberOfShards, int targetNumberOfShards, TimeValue coolDownRemaining, @Nullable Double writeLoad) Creates an instance of aAutoShardingResult
record class.- Parameters:
type
- the value for thetype
record componentcurrentNumberOfShards
- the value for thecurrentNumberOfShards
record componenttargetNumberOfShards
- the value for thetargetNumberOfShards
record componentcoolDownRemaining
- the value for thecoolDownRemaining
record componentwriteLoad
- the value for thewriteLoad
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 '=='. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
currentNumberOfShards
public int currentNumberOfShards()Returns the value of thecurrentNumberOfShards
record component.- Returns:
- the value of the
currentNumberOfShards
record component
-
targetNumberOfShards
public int targetNumberOfShards()Returns the value of thetargetNumberOfShards
record component.- Returns:
- the value of the
targetNumberOfShards
record component
-
coolDownRemaining
Returns the value of thecoolDownRemaining
record component.- Returns:
- the value of the
coolDownRemaining
record component
-
writeLoad
Returns the value of thewriteLoad
record component.- Returns:
- the value of the
writeLoad
record component
-