public class InstancedConfiguration extends Object implements AlluxioConfiguration
Modifier and Type | Field and Description |
---|---|
protected AlluxioProperties |
mProperties
Source of the truth of all property values (default or customized).
|
Constructor and Description |
---|
InstancedConfiguration(AlluxioConfiguration conf)
Creates a new instance of
InstancedConfiguration . |
InstancedConfiguration(AlluxioProperties properties)
Creates a new instance of
InstancedConfiguration . |
InstancedConfiguration(AlluxioProperties properties,
boolean clusterDefaultsLoaded)
Creates a new instance of
InstancedConfiguration . |
Modifier and Type | Method and Description |
---|---|
boolean |
clusterDefaultsLoaded() |
AlluxioProperties |
copyProperties()
Gets a copy of the
AlluxioProperties which back the AlluxioConfiguration . |
static InstancedConfiguration |
defaults()
Users should use this API to obtain a configuration for modification before passing to a
FileSystem constructor.
|
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.
|
Source |
getSource(PropertyKey key) |
String |
hash() |
boolean |
isSet(PropertyKey key)
Checks if the configuration contains a value for the given key.
|
boolean |
isSetByUser(PropertyKey key) |
Set<PropertyKey> |
keySet() |
void |
merge(Map<?,?> properties,
Source source)
Merges map of properties into the current alluxio properties.
|
void |
set(PropertyKey key,
Object value)
Sets the value for the appropriate key in the
Properties . |
void |
set(PropertyKey key,
Object value,
Source source)
Sets the value for the appropriate key in the
Properties by source. |
Map<String,String> |
toMap(ConfigurationValueOptions opts) |
void |
unset(PropertyKey key)
Unsets the value for the appropriate key in the
Properties . |
Set<PropertyKey> |
userKeySet() |
void |
validate()
Validates the configuration.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOrDefault, getOrDefault, toMap
protected AlluxioProperties mProperties
public InstancedConfiguration(AlluxioProperties properties)
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 defaults()
.properties
- alluxio properties underlying this configurationpublic InstancedConfiguration(AlluxioProperties properties, boolean clusterDefaultsLoaded)
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 defaults()
.properties
- alluxio properties underlying this configurationclusterDefaultsLoaded
- Whether or not the properties represent the cluster defaultspublic InstancedConfiguration(AlluxioConfiguration conf)
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 defaults()
.conf
- configuration to copypublic static InstancedConfiguration defaults()
public AlluxioProperties copyProperties()
AlluxioConfiguration
AlluxioProperties
which back the AlluxioConfiguration
.copyProperties
in interface AlluxioConfiguration
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 boolean isSetByUser(PropertyKey key)
isSetByUser
in interface AlluxioConfiguration
key
- the key to checkpublic void set(PropertyKey key, Object value)
Properties
.key
- the key to setvalue
- the value for the keypublic void set(PropertyKey key, Object value, Source source)
Properties
by source.key
- the key to setvalue
- the value for the keysource
- the source of the the properties (e.g., system property, default and etc)public void unset(PropertyKey key)
Properties
. If the PropertyKey
has a default value, it will still be considered set after executing this method.key
- the key to unsetpublic void merge(Map<?,?> properties, Source source)
properties
- map of keys to valuessource
- the source type for these propertiespublic Set<PropertyKey> keySet()
keySet
in interface AlluxioConfiguration
public Set<PropertyKey> userKeySet()
userKeySet
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 Map<String,String> toMap(ConfigurationValueOptions opts)
toMap
in interface AlluxioConfiguration
opts
- options for formatting the configuration valuespublic void validate()
AlluxioConfiguration
validate
in interface AlluxioConfiguration
public boolean clusterDefaultsLoaded()
clusterDefaultsLoaded
in interface AlluxioConfiguration
public String hash()
hash
in interface AlluxioConfiguration
Copyright © 2023. All Rights Reserved.