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
currentPerNodeMemoryBytes - the minimum size (memory) of all nodes in the cluster
currentTotalModelMemoryBytes - the sum of model memory over every assignment/deployment
currentTotalProcessorsInUse - the sum of processors used over every assignment/deployment
wantedMinNodes - the minimum number of nodes that must be provided by the autoscaler
wantedExtraPerNodeMemoryBytes - the amount of additional memory that must be provided on every node (this value must be >0 to trigger a scale up based on memory)
wantedExtraPerNodeNodeProcessors - the number of additional processors that must be provided on every node (this value must be >0 to trigger a scale up based on processors)
wantedExtraModelMemoryBytes - the amount of additional model memory that is newly required (due to a new assignment/deployment)
wantedExtraProcessors - the number of additional processors that are required to be added to the cluster
unwantedNodeMemoryBytesToRemove - the amount of memory that should be removed from the cluster. If this is equal to the amount of memory provided by a node, a node will 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.

  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • currentTotalNodes

      public int currentTotalNodes()
      Returns the value of the currentTotalNodes record component.
      Returns:
      the value of the currentTotalNodes record component
    • currentPerNodeMemoryBytes

      public long currentPerNodeMemoryBytes()
      Returns the value of the currentPerNodeMemoryBytes record component.
      Returns:
      the value of the currentPerNodeMemoryBytes record component
    • currentTotalModelMemoryBytes

      public long currentTotalModelMemoryBytes()
      Returns the value of the currentTotalModelMemoryBytes record component.
      Returns:
      the value of the currentTotalModelMemoryBytes record component
    • currentTotalProcessorsInUse

      public int currentTotalProcessorsInUse()
      Returns the value of the currentTotalProcessorsInUse record component.
      Returns:
      the value of the currentTotalProcessorsInUse record component
    • wantedMinNodes

      public int wantedMinNodes()
      Returns the value of the wantedMinNodes record component.
      Returns:
      the value of the wantedMinNodes record component
    • wantedExtraPerNodeMemoryBytes

      public long wantedExtraPerNodeMemoryBytes()
      Returns the value of the wantedExtraPerNodeMemoryBytes record component.
      Returns:
      the value of the wantedExtraPerNodeMemoryBytes record component
    • wantedExtraPerNodeNodeProcessors

      public int wantedExtraPerNodeNodeProcessors()
      Returns the value of the wantedExtraPerNodeNodeProcessors record component.
      Returns:
      the value of the wantedExtraPerNodeNodeProcessors record component
    • wantedExtraModelMemoryBytes

      public long wantedExtraModelMemoryBytes()
      Returns the value of the wantedExtraModelMemoryBytes record component.
      Returns:
      the value of the wantedExtraModelMemoryBytes record component
    • wantedExtraProcessors

      public int wantedExtraProcessors()
      Returns the value of the wantedExtraProcessors record component.
      Returns:
      the value of the wantedExtraProcessors record component
    • unwantedNodeMemoryBytesToRemove

      public long unwantedNodeMemoryBytesToRemove()
      Returns the value of the unwantedNodeMemoryBytesToRemove record component.
      Returns:
      the value of the unwantedNodeMemoryBytesToRemove record component
    • currentPerNodeMemoryOverheadBytes

      public long currentPerNodeMemoryOverheadBytes()
      Returns the value of the currentPerNodeMemoryOverheadBytes record component.
      Returns:
      the value of the currentPerNodeMemoryOverheadBytes record component