Record Class HealthMetadata.Disk

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

public static record HealthMetadata.Disk(RelativeByteSizeValue highWatermark, ByteSizeValue highMaxHeadroom, RelativeByteSizeValue floodStageWatermark, ByteSizeValue floodStageMaxHeadroom, RelativeByteSizeValue frozenFloodStageWatermark, ByteSizeValue frozenFloodStageMaxHeadroom) extends Record implements ToXContentFragment, Writeable
Contains the thresholds necessary to determine the health of the disk space of a node. The thresholds are determined by the elected master.
  • Field Details

  • Constructor Details

    • Disk

      public Disk(RelativeByteSizeValue highWatermark, ByteSizeValue highMaxHeadroom, RelativeByteSizeValue floodStageWatermark, ByteSizeValue floodStageMaxHeadroom, RelativeByteSizeValue frozenFloodStageWatermark, ByteSizeValue frozenFloodStageMaxHeadroom)
      Creates an instance of a Disk record class.
      Parameters:
      highWatermark - the value for the highWatermark record component
      highMaxHeadroom - the value for the highMaxHeadroom record component
      floodStageWatermark - the value for the floodStageWatermark record component
      floodStageMaxHeadroom - the value for the floodStageMaxHeadroom record component
      frozenFloodStageWatermark - the value for the frozenFloodStageWatermark record component
      frozenFloodStageMaxHeadroom - the value for the frozenFloodStageMaxHeadroom record component
  • Method Details

    • 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
    • toXContent

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

      public ByteSizeValue getFreeBytesHighWatermark(ByteSizeValue total)
    • getFreeBytesFloodStageWatermark

      public ByteSizeValue getFreeBytesFloodStageWatermark(ByteSizeValue total)
    • getFreeBytesFrozenFloodStageWatermark

      public ByteSizeValue getFreeBytesFrozenFloodStageWatermark(ByteSizeValue total)
    • describeHighWatermark

      public String describeHighWatermark()
    • describeFloodStageWatermark

      public String describeFloodStageWatermark()
    • describeFrozenFloodStageWatermark

      public String describeFrozenFloodStageWatermark()
    • equals

      public 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 Objects::equals(Object,Object).
      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.
    • hashCode

      public 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
    • newBuilder

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

      public static HealthMetadata.Disk.Builder newBuilder(HealthMetadata.Disk disk)
    • 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
    • highWatermark

      public RelativeByteSizeValue highWatermark()
      Returns the value of the highWatermark record component.
      Returns:
      the value of the highWatermark record component
    • highMaxHeadroom

      public ByteSizeValue highMaxHeadroom()
      Returns the value of the highMaxHeadroom record component.
      Returns:
      the value of the highMaxHeadroom record component
    • floodStageWatermark

      public RelativeByteSizeValue floodStageWatermark()
      Returns the value of the floodStageWatermark record component.
      Returns:
      the value of the floodStageWatermark record component
    • floodStageMaxHeadroom

      public ByteSizeValue floodStageMaxHeadroom()
      Returns the value of the floodStageMaxHeadroom record component.
      Returns:
      the value of the floodStageMaxHeadroom record component
    • frozenFloodStageWatermark

      public RelativeByteSizeValue frozenFloodStageWatermark()
      Returns the value of the frozenFloodStageWatermark record component.
      Returns:
      the value of the frozenFloodStageWatermark record component
    • frozenFloodStageMaxHeadroom

      public ByteSizeValue frozenFloodStageMaxHeadroom()
      Returns the value of the frozenFloodStageMaxHeadroom record component.
      Returns:
      the value of the frozenFloodStageMaxHeadroom record component