Class PersistedOptionValue

java.lang.Object
org.apache.drill.exec.server.options.PersistedOptionValue

public class PersistedOptionValue extends Object

This represents a persisted OptionValue. Decoupling the OptionValue from what is persisted will prevent us from accidentally breaking backward compatibility in the future when the OptionValue changes. Additionally when we do change the format of stored options we will not have to change much code since this is already designed with backward compatibility in mind. This class is also forward compatible with the Drill Option storage format in Drill 1.11 and earlier.

Contract: Only PersistedOptionValues created from an OptionValue should be persisted. And OptionValues should only be created from PersistedOptionValues that are retrieved from a store.

  • Field Details

    • SYSTEM_TYPE

      public static final String SYSTEM_TYPE
      This is present for forward compatability with Drill 1.11 and earlier
      See Also:
    • JSON_TYPE

      public static final String JSON_TYPE
      This constant cannot be changed for backward and forward compatibility reasons.
      See Also:
    • JSON_KIND

      public static final String JSON_KIND
      This constant cannot be changed for backward and forward compatibility reasons.
      See Also:
    • JSON_NAME

      public static final String JSON_NAME
      This constant cannot be changed for backward and forward compatibility reasons.
      See Also:
    • JSON_NUM_VAL

      public static final String JSON_NUM_VAL
      This constant cannot be changed for backward and forward compatibility reasons.
      See Also:
    • JSON_STRING_VAL

      public static final String JSON_STRING_VAL
      This constant cannot be changed for backward and forward compatibility reasons.
      See Also:
    • JSON_BOOL_VAL

      public static final String JSON_BOOL_VAL
      This constant cannot be changed for backward and forward compatibility reasons.
      See Also:
    • JSON_FLOAT_VAL

      public static final String JSON_FLOAT_VAL
      This constant cannot be changed for backward and forward compatibility reasons.
      See Also:
    • JSON_INTEGER_VAL

      public static final String JSON_INTEGER_VAL
      This constant cannot be changed for backward and forward compatibility reasons.
      See Also:
  • Constructor Details

  • Method Details

    • getValue

      public String getValue()
      This is ignored for forward compatibility.
    • getType

      public String getType()
      This is present for forward compatibility.
    • getKind

      public OptionValue.Kind getKind()
      This is present for forward compatibility.
    • getName

      public String getName()
      This is present for forward compatibility.
    • getNumVal

      public Long getNumVal()
      This is present for forward compatibility.
    • getStringVal

      public String getStringVal()
      This is present for forward compatibility.
    • getBoolVal

      public Boolean getBoolVal()
      This is present for forward compatibility.
    • getFloatVal

      public Double getFloatVal()
      This is present for forward compatibility.
    • toOptionValue

      public OptionValue toOptionValue(OptionDefinition optionDefinition, OptionValue.OptionScope optionScope)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object