Module org.elasticsearch.xcore
Record Class MlAutoscalingStats
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.ml.autoscaling.MlAutoscalingStats
- Record Components:
currentTotalNodes- The count of nodes that are currently in the cluster, used to confirm that both sides have same view of current statecurrentPerNodeMemoryBytes- The minimum size (memory) of all nodes in the cluster used to confirm that both sides have same view of current state.currentTotalModelMemoryBytes- The sum of model memory over every assignment/deployment, used to calculate requirementscurrentTotalProcessorsInUse- The sum of processors used over every assignment/deployment, not used by autoscalerwantedMinNodes- The minimum number of nodes that must be provided by the autoscalerwantedExtraPerNodeMemoryBytes- If there are jobs or trained models that have been started but cannot be allocated on the ML nodes currently within the cluster then this will be the *max* of the ML native memory requirements of those jobs/trained models. The metric is in terms of ML native memory, not container memory.wantedExtraPerNodeNodeProcessors- If there are trained model allocations that have been started but cannot be allocated on the ML nodes currently within the cluster then this will be the *max* of the vCPU requirements of those allocations. Zero otherwise.wantedExtraModelMemoryBytes- If there are jobs or trained models that have been started but cannot be allocated on the ML nodes currently within the cluster then this will be the *sum* of the ML native memory requirements of those jobs/trained models. The metric is in terms of ML native memory, not container memory.wantedExtraProcessors- If there are trained model allocations that have been started but cannot be allocated on the ML nodes currently within the cluster then this will be the *sum* of the vCPU requirements of those allocations. Zero otherwise.unwantedNodeMemoryBytesToRemove- The size of the ML node to be removed, in GB rounded to the nearest GB, or zero if no nodes could be removed.currentPerNodeMemoryOverheadBytes- Always equal to MachineLearning.NATIVE_EXECUTABLE_CODE_OVERHEAD,
- All Implemented Interfaces:
Writeable
public record MlAutoscalingStats(int currentTotalNodes, long currentPerNodeMemoryBytes, long currentTotalModelMemoryBytes, int currentTotalProcessorsInUse, int wantedMinNodes, long wantedExtraPerNodeMemoryBytes, int wantedExtraPerNodeNodeProcessors, long wantedExtraModelMemoryBytes, int wantedExtraProcessors, long unwantedNodeMemoryBytesToRemove, long currentPerNodeMemoryOverheadBytes)
extends Record
implements Writeable
MlAutoscalingStats is the record which is transmitted to the elasticsearch-autoscaler to decide which nodes to deliver.
The "existing" attributes exist only so that the autoscaler can confirm that elasticsearch has the same view of the available hardware.
The "extra" attributes are used to communicate the additional resources that are required.
The "perNode" attributes define the minimum amount of resources that must be available on every node.
unwantedNodeMemoryBytesToRemove is used to communicate the amount of memory that should be removed from the node. No attribute exists to remove processors.
The word "total" in an attribute name indicates that the attribute is a sum across all nodes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Constructor Summary
ConstructorsConstructorDescriptionMlAutoscalingStats(int currentTotalNodes, long currentPerNodeMemoryBytes, long currentTotalModelMemoryBytes, int currentTotalProcessorsInUse, int wantedMinNodes, long wantedExtraPerNodeMemoryBytes, int wantedExtraPerNodeNodeProcessors, long wantedExtraModelMemoryBytes, int wantedExtraProcessors, long unwantedNodeMemoryBytesToRemove, long currentPerNodeMemoryOverheadBytes) Creates an instance of aMlAutoscalingStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecurrentPerNodeMemoryBytesrecord component.longReturns the value of thecurrentPerNodeMemoryOverheadBytesrecord component.longReturns the value of thecurrentTotalModelMemoryBytesrecord component.intReturns the value of thecurrentTotalNodesrecord component.intReturns the value of thecurrentTotalProcessorsInUserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.longReturns the value of theunwantedNodeMemoryBytesToRemoverecord component.longReturns the value of thewantedExtraModelMemoryBytesrecord component.longReturns the value of thewantedExtraPerNodeMemoryBytesrecord component.intReturns the value of thewantedExtraPerNodeNodeProcessorsrecord component.intReturns the value of thewantedExtraProcessorsrecord component.intReturns the value of thewantedMinNodesrecord component.voidwriteTo(StreamOutput out)
-
Constructor Details
-
MlAutoscalingStats
- Throws:
IOException
-
MlAutoscalingStats
public MlAutoscalingStats(int currentTotalNodes, long currentPerNodeMemoryBytes, long currentTotalModelMemoryBytes, int currentTotalProcessorsInUse, int wantedMinNodes, long wantedExtraPerNodeMemoryBytes, int wantedExtraPerNodeNodeProcessors, long wantedExtraModelMemoryBytes, int wantedExtraProcessors, long unwantedNodeMemoryBytesToRemove, long currentPerNodeMemoryOverheadBytes) Creates an instance of aMlAutoscalingStatsrecord class.- Parameters:
currentTotalNodes- the value for thecurrentTotalNodesrecord componentcurrentPerNodeMemoryBytes- the value for thecurrentPerNodeMemoryBytesrecord componentcurrentTotalModelMemoryBytes- the value for thecurrentTotalModelMemoryBytesrecord componentcurrentTotalProcessorsInUse- the value for thecurrentTotalProcessorsInUserecord componentwantedMinNodes- the value for thewantedMinNodesrecord componentwantedExtraPerNodeMemoryBytes- the value for thewantedExtraPerNodeMemoryBytesrecord componentwantedExtraPerNodeNodeProcessors- the value for thewantedExtraPerNodeNodeProcessorsrecord componentwantedExtraModelMemoryBytes- the value for thewantedExtraModelMemoryBytesrecord componentwantedExtraProcessors- the value for thewantedExtraProcessorsrecord componentunwantedNodeMemoryBytesToRemove- the value for theunwantedNodeMemoryBytesToRemoverecord componentcurrentPerNodeMemoryOverheadBytes- the value for thecurrentPerNodeMemoryOverheadBytesrecord component
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
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. All components in this record class are compared with '=='. -
currentTotalNodes
public int currentTotalNodes()Returns the value of thecurrentTotalNodesrecord component.- Returns:
- the value of the
currentTotalNodesrecord component
-
currentPerNodeMemoryBytes
public long currentPerNodeMemoryBytes()Returns the value of thecurrentPerNodeMemoryBytesrecord component.- Returns:
- the value of the
currentPerNodeMemoryBytesrecord component
-
currentTotalModelMemoryBytes
public long currentTotalModelMemoryBytes()Returns the value of thecurrentTotalModelMemoryBytesrecord component.- Returns:
- the value of the
currentTotalModelMemoryBytesrecord component
-
currentTotalProcessorsInUse
public int currentTotalProcessorsInUse()Returns the value of thecurrentTotalProcessorsInUserecord component.- Returns:
- the value of the
currentTotalProcessorsInUserecord component
-
wantedMinNodes
public int wantedMinNodes()Returns the value of thewantedMinNodesrecord component.- Returns:
- the value of the
wantedMinNodesrecord component
-
wantedExtraPerNodeMemoryBytes
public long wantedExtraPerNodeMemoryBytes()Returns the value of thewantedExtraPerNodeMemoryBytesrecord component.- Returns:
- the value of the
wantedExtraPerNodeMemoryBytesrecord component
-
wantedExtraPerNodeNodeProcessors
public int wantedExtraPerNodeNodeProcessors()Returns the value of thewantedExtraPerNodeNodeProcessorsrecord component.- Returns:
- the value of the
wantedExtraPerNodeNodeProcessorsrecord component
-
wantedExtraModelMemoryBytes
public long wantedExtraModelMemoryBytes()Returns the value of thewantedExtraModelMemoryBytesrecord component.- Returns:
- the value of the
wantedExtraModelMemoryBytesrecord component
-
wantedExtraProcessors
public int wantedExtraProcessors()Returns the value of thewantedExtraProcessorsrecord component.- Returns:
- the value of the
wantedExtraProcessorsrecord component
-
unwantedNodeMemoryBytesToRemove
public long unwantedNodeMemoryBytesToRemove()Returns the value of theunwantedNodeMemoryBytesToRemoverecord component.- Returns:
- the value of the
unwantedNodeMemoryBytesToRemoverecord component
-
currentPerNodeMemoryOverheadBytes
public long currentPerNodeMemoryOverheadBytes()Returns the value of thecurrentPerNodeMemoryOverheadBytesrecord component.- Returns:
- the value of the
currentPerNodeMemoryOverheadBytesrecord component
-