public class InstancedConfiguration extends Object implements AlluxioConfiguration
Constructor and Description |
---|
InstancedConfiguration(AlluxioProperties properties) |
InstancedConfiguration(InstancedConfiguration conf) |
Modifier and Type | Method and Description |
---|---|
String |
get(PropertyKey key)
Gets the value for the given key in the
Properties ; if this key is not found, a
RuntimeException is thrown. |
String |
get(PropertyKey key,
ConfigurationValueOptions options)
Gets the value for the given key in the
Properties ; 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> 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 Enum<T>> |
getEnum(PropertyKey key,
Class<T> enumType)
Gets the value for the given key as an enum value.
|
float |
getFloat(PropertyKey key)
Gets the float representation of the value for the given key.
|
int |
getInt(PropertyKey key)
Gets the integer representation of the value for the given key.
|
List<String> |
getList(PropertyKey key,
String delimiter)
Gets the value for the given key as a list.
|
long |
getLong(PropertyKey key)
Gets the long representation of the value for the given key.
|
long |
getMs(PropertyKey key)
Gets the time of key in millisecond unit.
|
Map<String,String> |
getNestedProperties(PropertyKey prefixKey)
Gets a set of properties that share a given common prefix key as a map.
|
AlluxioProperties |
getProperties() |
Source |
getSource(PropertyKey key) |
boolean |
isSet(PropertyKey key)
Checks if the configuration contains a value for the given key.
|
Set<PropertyKey> |
keySet() |
void |
merge(Map<?,?> properties,
Source source)
Merges the current configuration properties with new properties.
|
Map<String,String> |
toMap(ConfigurationValueOptions opts) |
void |
validate()
Validates the configuration.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOrDefault, getOrDefault, toMap
public InstancedConfiguration(AlluxioProperties properties)
properties
- alluxio properties underlying this configurationpublic InstancedConfiguration(InstancedConfiguration conf)
conf
- configuration to copypublic AlluxioProperties getProperties()
public String get(PropertyKey key)
AlluxioConfiguration
Properties
; if this key is not found, a
RuntimeException is thrown.get
in interface AlluxioConfiguration
key
- the key to get the value forpublic String get(PropertyKey key, ConfigurationValueOptions options)
AlluxioConfiguration
Properties
; if this key is not found, a
RuntimeException is thrown.get
in interface AlluxioConfiguration
key
- the key to get the value foroptions
- options for getting configuration valuepublic boolean isSet(PropertyKey key)
AlluxioConfiguration
isSet
in interface AlluxioConfiguration
key
- the key to checkpublic Set<PropertyKey> keySet()
keySet
in interface AlluxioConfiguration
public int getInt(PropertyKey key)
AlluxioConfiguration
getInt
in interface AlluxioConfiguration
key
- the key to get the value forint
public long getLong(PropertyKey key)
AlluxioConfiguration
getLong
in interface AlluxioConfiguration
key
- the key to get the value forlong
public double getDouble(PropertyKey key)
AlluxioConfiguration
getDouble
in interface AlluxioConfiguration
key
- the key to get the value fordouble
public float getFloat(PropertyKey key)
AlluxioConfiguration
getFloat
in interface AlluxioConfiguration
key
- the key to get the value forfloat
public boolean getBoolean(PropertyKey key)
AlluxioConfiguration
getBoolean
in interface AlluxioConfiguration
key
- the key to get the value forboolean
public List<String> getList(PropertyKey key, String delimiter)
AlluxioConfiguration
getList
in interface AlluxioConfiguration
key
- the key to get the value fordelimiter
- the delimiter to split the valuespublic <T extends Enum<T>> T getEnum(PropertyKey key, Class<T> enumType)
AlluxioConfiguration
getEnum
in interface AlluxioConfiguration
T
- the type of the enumkey
- the key to get the value forenumType
- the type of the enumpublic long getBytes(PropertyKey key)
AlluxioConfiguration
getBytes
in interface AlluxioConfiguration
key
- the key to get the value forpublic long getMs(PropertyKey key)
AlluxioConfiguration
getMs
in interface AlluxioConfiguration
key
- the key to get the value forpublic java.time.Duration getDuration(PropertyKey key)
AlluxioConfiguration
getDuration
in interface AlluxioConfiguration
key
- the key to get the value forpublic <T> Class<T> getClass(PropertyKey key)
AlluxioConfiguration
getClass
in interface AlluxioConfiguration
T
- the type of the classkey
- the key to get the value forpublic Map<String,String> getNestedProperties(PropertyKey prefixKey)
AlluxioConfiguration
getNestedProperties
in interface AlluxioConfiguration
prefixKey
- the prefix keypublic Source getSource(PropertyKey key)
getSource
in interface AlluxioConfiguration
key
- the property keypublic void merge(Map<?,?> properties, Source source)
AlluxioConfiguration
merge
in interface AlluxioConfiguration
properties
- the source Properties
to be mergedsource
- the source of the the properties (e.g., system property, default and etc)public Map<String,String> toMap(ConfigurationValueOptions opts)
toMap
in interface AlluxioConfiguration
opts
- options for formatting the configuration valuespublic void validate()
AlluxioConfiguration
validate
in interface AlluxioConfiguration
Copyright © 2023. All Rights Reserved.