Package alluxio.underfs
Class UnderFileSystemConfiguration
- java.lang.Object
-
- alluxio.underfs.UnderFileSystemConfiguration
-
- All Implemented Interfaces:
AlluxioConfiguration
@NotThreadSafe @PublicApi public final class UnderFileSystemConfiguration extends java.lang.Object implements AlluxioConfiguration
Ufs configuration properties, including ufs specific configuration and global configuration.
The order of precedence for properties is:
- Ufs specific properties
- Global configuration properties
This class extends
InstancedConfiguration
. Variable substitution and aliases are supported.
-
-
Constructor Summary
Constructors Constructor Description UnderFileSystemConfiguration(AlluxioConfiguration alluxioConf, boolean readOnly)
Constructs a new instance ofUnderFileSystemConfiguration
with the given properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
clusterDefaultsLoaded()
AlluxioProperties
copyProperties()
Gets a copy of theAlluxioProperties
which back theAlluxioConfiguration
.UnderFileSystemConfiguration
createMountSpecificConf(java.util.Map<java.lang.String,? extends java.lang.Object> mountConf)
Creates a new instance from the current configuration and adds in new properties.static UnderFileSystemConfiguration
defaults(AlluxioConfiguration alluxioConf)
static UnderFileSystemConfiguration
emptyConfig()
java.lang.Object
get(PropertyKey key)
Gets the value for the given key in theProperties
; if this key is not found, a RuntimeException is thrown.java.lang.Object
get(PropertyKey key, ConfigurationValueOptions options)
Gets the value for the given key in theProperties
; if this key is not found, a RuntimeException is thrown.boolean
getBoolean(PropertyKey key)
Gets the boolean representation of the value for the given key.long
getBytes(PropertyKey key)
Gets the bytes of the value for the given key.<T> java.lang.Class<T>
getClass(PropertyKey key)
Gets the value for the given key as a class.double
getDouble(PropertyKey key)
Gets the double representation of the value for the given key.java.time.Duration
getDuration(PropertyKey key)
Gets the time of the key as a duration.<T extends java.lang.Enum<T>>
TgetEnum(PropertyKey key, java.lang.Class<T> enumType)
Gets the value for the given key as an enum value.int
getInt(PropertyKey key)
Gets the integer representation of the value for the given key.java.util.List<java.lang.String>
getList(PropertyKey key)
Gets the value for the given key as a list.long
getLong(PropertyKey key)
Gets the long integer representation of the value for the given key.java.util.Map<java.lang.String,java.lang.Object>
getMountSpecificConf()
long
getMs(PropertyKey key)
Gets the time of key in millisecond unit.java.util.Map<java.lang.String,java.lang.Object>
getNestedProperties(PropertyKey prefixKey)
Gets a set of properties that share a given common prefix key as a map.Source
getSource(PropertyKey key)
java.lang.String
getString(PropertyKey key)
Gets the String value for the given key.boolean
isReadOnly()
boolean
isSet(PropertyKey key)
Checks if the configuration contains a value for the given key.boolean
isSetByUser(PropertyKey key)
java.util.Set<PropertyKey>
keySet()
java.util.Map<java.lang.String,java.lang.Object>
toMap(ConfigurationValueOptions opts)
java.util.Map<java.lang.String,java.lang.String>
toUserPropertyMap(ConfigurationValueOptions options)
java.util.Set<PropertyKey>
userKeySet()
void
validate()
Validates the configuration.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface alluxio.conf.AlluxioConfiguration
getOrDefault, getOrDefault, hash, toMap
-
-
-
-
Constructor Detail
-
UnderFileSystemConfiguration
public UnderFileSystemConfiguration(AlluxioConfiguration alluxioConf, boolean readOnly)
Constructs a new instance ofUnderFileSystemConfiguration
with the given properties.- Parameters:
alluxioConf
- Alluxio configurationreadOnly
- whether only read operations are permitted
-
-
Method Detail
-
defaults
public static UnderFileSystemConfiguration defaults(AlluxioConfiguration alluxioConf)
- Parameters:
alluxioConf
- Alluxio configuration- Returns:
- ufs configuration from a given alluxio configuration
-
emptyConfig
public static UnderFileSystemConfiguration emptyConfig()
- Returns:
- ufs configuration with empty config
-
getMountSpecificConf
public java.util.Map<java.lang.String,java.lang.Object> getMountSpecificConf()
- Returns:
- the map of resolved mount specific configuration
-
isReadOnly
public boolean isReadOnly()
- Returns:
- whether only read operations are permitted to the
UnderFileSystem
-
createMountSpecificConf
public UnderFileSystemConfiguration createMountSpecificConf(java.util.Map<java.lang.String,? extends java.lang.Object> mountConf)
Creates a new instance from the current configuration and adds in new properties.- Parameters:
mountConf
- the mount specific configuration map- Returns:
- the updated configuration object
-
toUserPropertyMap
public java.util.Map<java.lang.String,java.lang.String> toUserPropertyMap(ConfigurationValueOptions options)
- Parameters:
options
- options for formatting the configuration values- Returns:
- a map from all user configuration property names to their values; values may potentially be null
-
get
public java.lang.Object get(PropertyKey key)
Description copied from interface:AlluxioConfiguration
Gets the value for the given key in theProperties
; if this key is not found, a RuntimeException is thrown.- Specified by:
get
in interfaceAlluxioConfiguration
- 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 theProperties
; if this key is not found, a RuntimeException is thrown.- Specified by:
get
in interfaceAlluxioConfiguration
- Parameters:
key
- the key to get the value foroptions
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- 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
-
keySet
public java.util.Set<PropertyKey> keySet()
- Specified by:
keySet
in interfaceAlluxioConfiguration
- Returns:
- the keys configured by the configuration
-
userKeySet
public java.util.Set<PropertyKey> userKeySet()
- Specified by:
userKeySet
in interfaceAlluxioConfiguration
- Returns:
- the keys set by user
-
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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- Type Parameters:
T
- the type of the enum- Parameters:
key
- the key to get the value forenumType
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- 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 interfaceAlluxioConfiguration
- Parameters:
prefixKey
- the prefix key- Returns:
- a map from nested properties aggregated by the prefix
-
copyProperties
public AlluxioProperties copyProperties()
Description copied from interface:AlluxioConfiguration
Gets a copy of theAlluxioProperties
which back theAlluxioConfiguration
.- Specified by:
copyProperties
in interfaceAlluxioConfiguration
- Returns:
- A copy of AlluxioProperties representing the configuration
-
getSource
public Source getSource(PropertyKey key)
- Specified by:
getSource
in interfaceAlluxioConfiguration
- Parameters:
key
- the property key- Returns:
- the source for the given key
-
toMap
public java.util.Map<java.lang.String,java.lang.Object> toMap(ConfigurationValueOptions opts)
- Specified by:
toMap
in interfaceAlluxioConfiguration
- Parameters:
opts
- options for formatting the configuration values- Returns:
- a map from all configuration property names to their values; values may potentially be null
-
validate
public void validate()
Description copied from interface:AlluxioConfiguration
Validates the configuration.- Specified by:
validate
in interfaceAlluxioConfiguration
-
clusterDefaultsLoaded
public boolean clusterDefaultsLoaded()
- Specified by:
clusterDefaultsLoaded
in interfaceAlluxioConfiguration
- Returns:
- whether the configuration has been merged with cluster defaults
-
-