Class RelativeByteSizeValue

java.lang.Object
org.elasticsearch.common.unit.RelativeByteSizeValue

public class RelativeByteSizeValue extends Object
A byte size value that allows specification using either of: 1. Absolute value (200GB for instance) 2. Relative percentage value (95%) 3. Relative ratio value (0.95)
  • Field Details

  • Constructor Details

    • RelativeByteSizeValue

      public RelativeByteSizeValue(ByteSizeValue absolute)
    • RelativeByteSizeValue

      public RelativeByteSizeValue(RatioValue ratio)
  • Method Details

    • isAbsolute

      public boolean isAbsolute()
    • getAbsolute

      public ByteSizeValue getAbsolute()
    • getRatio

      public RatioValue getRatio()
    • calculateValue

      public ByteSizeValue calculateValue(ByteSizeValue total, ByteSizeValue maxHeadroom)
      Calculate the size to use, optionally catering for a max headroom.
      Parameters:
      total - the total size to use
      maxHeadroom - the max headroom to cater for or null (or -1) to ignore.
      Returns:
      the size to use
    • isNonZeroSize

      public boolean isNonZeroSize()
    • parseRelativeByteSizeValue

      public static RelativeByteSizeValue parseRelativeByteSizeValue(String value, String settingName)
    • getStringRep

      public String getStringRep()