Package alluxio.conf

Class InstancedConfiguration

  • All Implemented Interfaces:
    AlluxioConfiguration

    public class InstancedConfiguration
    extends java.lang.Object
    implements AlluxioConfiguration
    Alluxio configuration. WARNING: This API is not intended to be used outside of internal Alluxio code and may be changed or removed in a future minor release. Application code should use APIs Configuration.
    • Field Detail

      • mProperties

        protected final AlluxioProperties mProperties
        Source of the truth of all property values (default or customized).
    • Constructor Detail

      • InstancedConfiguration

        public InstancedConfiguration​(AlluxioProperties properties)
        Creates a new instance of InstancedConfiguration. WARNING: This API is not intended to be used outside of internal Alluxio code and may be changed or removed in a future minor release. Application code should use Configuration.global().
        Parameters:
        properties - alluxio properties underlying this configuration
      • InstancedConfiguration

        public InstancedConfiguration​(AlluxioProperties properties,
                                      boolean clusterDefaultsLoaded)
        Creates a new instance of InstancedConfiguration. WARNING: This API is not intended to be used outside of internal Alluxio code and may be changed or removed in a future minor release. Application code should use Configuration.global().
        Parameters:
        properties - alluxio properties underlying this configuration
        clusterDefaultsLoaded - Whether or not the properties represent the cluster defaults
    • Method Detail

      • getProperties

        public AlluxioProperties getProperties()
        Return reference to mProperties.
        Returns:
        mProperties
      • get

        public java.lang.Object get​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the value for the given key in the Properties; if this key is not found, a RuntimeException is thrown.
        Specified by:
        get in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the value for the given key
      • get

        public java.lang.Object get​(PropertyKey key,
                                    ConfigurationValueOptions options)
        Description copied from interface: AlluxioConfiguration
        Gets the value for the given key in the Properties; if this key is not found, a RuntimeException is thrown.
        Specified by:
        get in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        options - options for getting configuration value
        Returns:
        the value for the given key
      • isSet

        public boolean isSet​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Checks if the configuration contains a value for the given key.
        Specified by:
        isSet in interface AlluxioConfiguration
        Parameters:
        key - the key to check
        Returns:
        true if there is value for the key, false otherwise
      • isSetByUser

        public boolean isSetByUser​(PropertyKey key)
        Specified by:
        isSetByUser in interface AlluxioConfiguration
        Parameters:
        key - the key to check
        Returns:
        true if there is value for the key set by user, false otherwise even when there is a default value for the key
      • set

        public void set​(PropertyKey key,
                        java.lang.Object value)
        Sets the value for the appropriate key in the Properties.
        Parameters:
        key - the key to set
        value - the value for the key
      • set

        @Deprecated
        public void set​(@Nonnull
                        PropertyKey key,
                        @Nonnull
                        java.lang.String value)
        Deprecated.
        API to aid property key type transition
        Sets the value for the appropriate key in the Properties.
        Parameters:
        key - the key to set
        value - the value for the key
      • set

        public void set​(@Nonnull
                        PropertyKey key,
                        @Nonnull
                        java.lang.Object value,
                        @Nonnull
                        Source source)
        Sets the value for the appropriate key in the Properties by source.
        Parameters:
        key - the key to set
        value - the value for the key
        source - the source of the the properties (e.g., system property, default and etc)
      • unset

        public void unset​(PropertyKey key)
        Unsets the value for the appropriate key in the Properties. If the PropertyKey has a default value, it will still be considered set after executing this method.
        Parameters:
        key - the key to unset
      • merge

        public void merge​(java.util.Map<?,​?> properties,
                          Source source)
        Merges map of properties into the current alluxio properties.
        Parameters:
        properties - map of keys to values
        source - the source type for these properties
      • getString

        public java.lang.String getString​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the String value for the given key.
        Specified by:
        getString in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the value for the given key as an String
      • getInt

        public int getInt​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the integer representation of the value for the given key.
        Specified by:
        getInt in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the value for the given key as an int
      • getLong

        public long getLong​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the long integer representation of the value for the given key.
        Specified by:
        getLong in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the value for the given key as a long
      • getDouble

        public double getDouble​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the double representation of the value for the given key.
        Specified by:
        getDouble in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the value for the given key as a double
      • getBoolean

        public boolean getBoolean​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the boolean representation of the value for the given key.
        Specified by:
        getBoolean in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the value for the given key as a boolean
      • getList

        public java.util.List<java.lang.String> getList​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the value for the given key as a list.
        Specified by:
        getList in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the list of values for the given key
      • getEnum

        public <T extends java.lang.Enum<T>> T getEnum​(PropertyKey key,
                                                       java.lang.Class<T> enumType)
        Description copied from interface: AlluxioConfiguration
        Gets the value for the given key as an enum value.
        Specified by:
        getEnum in interface AlluxioConfiguration
        Type Parameters:
        T - the type of the enum
        Parameters:
        key - the key to get the value for
        enumType - the type of the enum
        Returns:
        the value for the given key as an enum value
      • getBytes

        public long getBytes​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the bytes of the value for the given key.
        Specified by:
        getBytes in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the bytes of the value for the given key
      • getMs

        public long getMs​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the time of key in millisecond unit.
        Specified by:
        getMs in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the time of key in millisecond unit
      • getDuration

        public java.time.Duration getDuration​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the time of the key as a duration.
        Specified by:
        getDuration in interface AlluxioConfiguration
        Parameters:
        key - the key to get the value for
        Returns:
        the value of the key represented as a duration
      • getClass

        public <T> java.lang.Class<T> getClass​(PropertyKey key)
        Description copied from interface: AlluxioConfiguration
        Gets the value for the given key as a class.
        Specified by:
        getClass in interface AlluxioConfiguration
        Type Parameters:
        T - the type of the class
        Parameters:
        key - the key to get the value for
        Returns:
        the value for the given key as a class
      • getNestedProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getNestedProperties​(PropertyKey prefixKey)
        Description copied from interface: AlluxioConfiguration
        Gets a set of properties that share a given common prefix key as a map. E.g., if A.B=V1 and A.C=V2, calling this method with prefixKey=A returns a map of {B=V1, C=V2}, where B and C are also valid properties. If no property shares the prefix, an empty map is returned.
        Specified by:
        getNestedProperties in interface AlluxioConfiguration
        Parameters:
        prefixKey - the prefix key
        Returns:
        a map from nested properties aggregated by the prefix
      • toMap

        public java.util.Map<java.lang.String,​java.lang.Object> toMap​(ConfigurationValueOptions opts)
        Specified by:
        toMap in interface AlluxioConfiguration
        Parameters:
        opts - options for formatting the configuration values
        Returns:
        a map from all configuration property names to their values; values may potentially be null
      • clusterDefaultsLoaded

        public boolean clusterDefaultsLoaded()
        Specified by:
        clusterDefaultsLoaded in interface AlluxioConfiguration
        Returns:
        whether the configuration has been merged with cluster defaults
      • hash

        public java.lang.String hash()
        Specified by:
        hash in interface AlluxioConfiguration
        Returns:
        hash of properties, if hashing is not supported, return empty string