Package alluxio.conf

Class PropertyKey.Builder

  • Enclosing class:
    PropertyKey

    public static final class PropertyKey.Builder
    extends java.lang.Object
    Builder to create PropertyKey instances. Note that, Builder.build() will throw exception if there is an existing property built with the same name.
    • Constructor Detail

      • Builder

        public Builder​(PropertyKey.Template template,
                       java.lang.Object... params)
        Parameters:
        template - template for the property name
        params - parameters of the template
      • Builder

        public Builder​(PropertyKey.PropertyType type,
                       PropertyKey.Template template,
                       java.lang.Object... params)
        Parameters:
        type - type of the property
        template - template for the property name
        params - parameters of the template
      • Builder

        public Builder​(PropertyKey.PropertyType type,
                       java.util.Optional<java.lang.String> delimiter,
                       PropertyKey.Template template,
                       java.lang.Object... params)
        Parameters:
        type - type of the property
        delimiter - delimiter for value, if list value is given as a string
        template - template for the property name
        params - parameters of the template
    • Method Detail

      • booleanBuilder

        public static PropertyKey.Builder booleanBuilder​(java.lang.String name)
        Parameters:
        name - name of the property
        Returns:
        a Builder for boolean properties
      • intBuilder

        public static PropertyKey.Builder intBuilder​(java.lang.String name)
        Parameters:
        name - name of the property
        Returns:
        a Builder for int properties
      • longBuilder

        public static PropertyKey.Builder longBuilder​(java.lang.String name)
        Parameters:
        name - name of the property
        Returns:
        a Builder for int properties
      • doubleBuilder

        public static PropertyKey.Builder doubleBuilder​(java.lang.String name)
        Parameters:
        name - name of the property
        Returns:
        a Builder for double properties
      • stringBuilder

        public static PropertyKey.Builder stringBuilder​(java.lang.String name)
        Parameters:
        name - name of the property
        Returns:
        a Builder for string properties
      • enumBuilder

        public static PropertyKey.Builder enumBuilder​(java.lang.String name,
                                                      java.lang.Class<? extends java.lang.Enum> enumType)
        Parameters:
        name - name of the property
        enumType - enum class of the property
        Returns:
        a Builder for enum properties
      • durationBuilder

        public static PropertyKey.Builder durationBuilder​(java.lang.String name)
        Parameters:
        name - name of the property
        Returns:
        a Builder for time duration properties
      • dataSizeBuilder

        public static PropertyKey.Builder dataSizeBuilder​(java.lang.String name)
        Parameters:
        name - name of the property
        Returns:
        a Builder for data size properties
      • classBuilder

        public static PropertyKey.Builder classBuilder​(java.lang.String name)
        Parameters:
        name - name of the property
        Returns:
        a Builder for class properties
      • listBuilder

        public static PropertyKey.Builder listBuilder​(java.lang.String name)
        Parameters:
        name - name of the property
        Returns:
        a Builder for list properties
      • setAlias

        public PropertyKey.Builder setAlias​(java.lang.String... aliases)
        Parameters:
        aliases - aliases for the property
        Returns:
        the updated builder instance
      • setDelimiter

        public PropertyKey.Builder setDelimiter​(java.lang.String delimiter)
        Parameters:
        delimiter - the delimiter
        Returns:
        the updated builder instance
      • setName

        public PropertyKey.Builder setName​(java.lang.String name)
        Parameters:
        name - name for the property
        Returns:
        the updated builder instance
      • setDefaultSupplier

        public PropertyKey.Builder setDefaultSupplier​(DefaultSupplier defaultSupplier)
        Parameters:
        defaultSupplier - supplier for the property's default value
        Returns:
        the updated builder instance
      • setDefaultSupplier

        public PropertyKey.Builder setDefaultSupplier​(java.util.function.Supplier<java.lang.Object> supplier,
                                                      java.lang.String description)
        Parameters:
        supplier - supplier for the property's default value
        description - description of the default value
        Returns:
        the updated builder instance
      • setDefaultValue

        public PropertyKey.Builder setDefaultValue​(java.lang.Object defaultValue)
        Parameters:
        defaultValue - the property's default value
        Returns:
        the updated builder instance
      • setDescription

        public PropertyKey.Builder setDescription​(java.lang.String description)
        Parameters:
        description - of the property
        Returns:
        the updated builder instance
      • setIsBuiltIn

        public PropertyKey.Builder setIsBuiltIn​(boolean isBuiltIn)
        Parameters:
        isBuiltIn - whether to the property is a built-in Alluxio property
        Returns:
        the updated builder instance
      • setIsHidden

        public PropertyKey.Builder setIsHidden​(boolean isHidden)
        Parameters:
        isHidden - whether to hide the property when generating property documentation
        Returns:
        the updated builder instance
      • setIgnoredSiteProperty

        public PropertyKey.Builder setIgnoredSiteProperty​(boolean ignoredSiteProperty)
        Parameters:
        ignoredSiteProperty - whether the property should be ignored in alluxio-site.properties
        Returns:
        the updated builder instance
      • setConsistencyCheckLevel

        public PropertyKey.Builder setConsistencyCheckLevel​(PropertyKey.ConsistencyCheckLevel consistencyCheckLevel)
        Parameters:
        consistencyCheckLevel - the consistency level that applies to this property
        Returns:
        the updated builder instance
      • setScope

        public PropertyKey.Builder setScope​(alluxio.grpc.Scope scope)
        Parameters:
        scope - which components this property applies to
        Returns:
        the updated builder instance
      • setDisplayType

        public PropertyKey.Builder setDisplayType​(PropertyKey.DisplayType displayType)
        Parameters:
        displayType - the displayType that indicates how the property value should be displayed
        Returns:
        the updated builder instance
      • setIsDynamic

        public PropertyKey.Builder setIsDynamic​(boolean dynamic)
        Parameters:
        dynamic - whether the property could be updated dynamically
        Returns:
        the updated builder instance
      • setValueValidationFunction

        public PropertyKey.Builder setValueValidationFunction​(java.util.function.Function<java.lang.Object,​java.lang.Boolean> valueValidationFunction)
        Parameters:
        valueValidationFunction - custom function to validate the property value
        Returns:
        the updated builder instance
      • build

        public PropertyKey build()
        Creates and registers the property key.
        Returns:
        the created property key instance
      • buildUnregistered

        public PropertyKey buildUnregistered()
        Creates the property key without registering it with default property list.
        Returns:
        the created property key instance
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object