Package alluxio.conf.path
Class SpecificPathConfiguration
- java.lang.Object
-
- alluxio.conf.path.SpecificPathConfiguration
-
- All Implemented Interfaces:
AlluxioConfiguration
@ThreadSafe public final class SpecificPathConfiguration extends java.lang.Object implements AlluxioConfiguration
Configuration for a specific Alluxio path. Priority for the value of a property follows: 1. matched path level configuration; 2. cluster level configuration.
-
-
Constructor Summary
Constructors Constructor Description SpecificPathConfiguration(AlluxioConfiguration clusterConf, PathConfiguration pathConf, AlluxioURI path)
Constructs a new instance with the specified references without copying the underlying properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
clusterDefaultsLoaded()
AlluxioProperties
copyProperties()
Gets a copy of theAlluxioProperties
which back theAlluxioConfiguration
.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.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
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.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
-
SpecificPathConfiguration
public SpecificPathConfiguration(AlluxioConfiguration clusterConf, PathConfiguration pathConf, AlluxioURI path)
Constructs a new instance with the specified references without copying the underlying properties.- Parameters:
clusterConf
- the cluster level configurationpathConf
- the path level configurationpath
- the specific Alluxio path
-
-
Method Detail
-
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
-
-