Record Class HealthMetadata.ShardLimits

java.lang.Object
java.lang.Record
org.elasticsearch.health.metadata.HealthMetadata.ShardLimits
All Implemented Interfaces:
Writeable, ToXContent, ToXContentFragment
Enclosing class:
HealthMetadata

public static record HealthMetadata.ShardLimits(int maxShardsPerNode, int maxShardsPerNodeFrozen) extends Record implements ToXContentFragment, Writeable
Contains the thresholds needed to determine the health of a cluster when it comes to the amount of room available to create new shards. These values are determined by the elected master.
  • Constructor Details

    • ShardLimits

      public ShardLimits(int maxShardsPerNode, int maxShardsPerNodeFrozen)
      Creates an instance of a ShardLimits record class.
      Parameters:
      maxShardsPerNode - the value for the maxShardsPerNode record component
      maxShardsPerNodeFrozen - the value for the maxShardsPerNodeFrozen record component
  • Method Details

    • toXContent

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      IOException
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • newBuilder

      public static HealthMetadata.ShardLimits.Builder newBuilder()
    • newBuilder

      public static HealthMetadata.ShardLimits.Builder newBuilder(HealthMetadata.ShardLimits shardLimits)
    • 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.
    • maxShardsPerNode

      public int maxShardsPerNode()
      Returns the value of the maxShardsPerNode record component.
      Returns:
      the value of the maxShardsPerNode record component
    • maxShardsPerNodeFrozen

      public int maxShardsPerNodeFrozen()
      Returns the value of the maxShardsPerNodeFrozen record component.
      Returns:
      the value of the maxShardsPerNodeFrozen record component