public class InstancedConfiguration extends Object implements AlluxioConfiguration
Configuration
.Modifier and Type | Class and Description |
---|---|
protected class |
InstancedConfiguration.UnresolvablePropertyException |
Modifier and Type | Field and Description |
---|---|
protected AlluxioProperties |
mProperties
Source of the truth of all property values (default or customized).
|
Constructor and Description |
---|
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 . |
Object |
get(PropertyKey key)
Gets the value for the given key in the
Properties ; if this key is not found, a
RuntimeException is thrown. |
Object |
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.
|
int |
getInt(PropertyKey key)
Gets the integer representation of the value for the given key.
|
long |
getLastUpdateTime() |
List<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.
|
Map<String,Object> |
getNestedProperties(PropertyKey prefixKey)
Gets a set of properties that share a given common prefix key as a map.
|
AlluxioProperties |
getProperties()
Return reference to mProperties.
|
Source |
getSource(PropertyKey key) |
String |
getString(PropertyKey key)
Gets the String value for the given 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() |
protected Object |
lookup(PropertyKey key,
String base)
Lookup key names to handle ${key} stuff.
|
protected Object |
lookupRecursively(PropertyKey originalKey,
String base,
Set<String> seen)
Actual recursive lookup replacement.
|
void |
merge(AlluxioProperties properties)
Merges map of properties into the current alluxio properties.
|
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. |
void |
set(PropertyKey key,
String value)
Deprecated.
API to aid property key type transition
|
Map<String,Object> |
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 final 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 Configuration.global()
.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 Configuration.global()
.properties
- alluxio properties underlying this configurationclusterDefaultsLoaded
- Whether or not the properties represent the cluster defaultspublic AlluxioProperties getProperties()
public AlluxioProperties copyProperties()
AlluxioConfiguration
AlluxioProperties
which back the AlluxioConfiguration
.copyProperties
in interface AlluxioConfiguration
public Object 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 Object 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 key@Deprecated public void set(@Nonnull PropertyKey key, @Nonnull String value)
Properties
.key
- the key to setvalue
- the value for the keypublic void set(@Nonnull PropertyKey key, @Nonnull Object value, @Nonnull 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 void merge(AlluxioProperties properties)
properties
- map of keys to valuespublic Set<PropertyKey> keySet()
keySet
in interface AlluxioConfiguration
public Set<PropertyKey> userKeySet()
userKeySet
in interface AlluxioConfiguration
public String getString(PropertyKey key)
AlluxioConfiguration
getString
in interface AlluxioConfiguration
key
- the key to get the value forString
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 boolean getBoolean(PropertyKey key)
AlluxioConfiguration
getBoolean
in interface AlluxioConfiguration
key
- the key to get the value forboolean
public List<String> getList(PropertyKey key)
AlluxioConfiguration
getList
in interface AlluxioConfiguration
key
- the key to get the value forpublic <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,Object> 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,Object> 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
protected Object lookup(PropertyKey key, String base) throws InstancedConfiguration.UnresolvablePropertyException
base
- the String to look forInstancedConfiguration.UnresolvablePropertyException
protected Object lookupRecursively(PropertyKey originalKey, String base, Set<String> seen) throws InstancedConfiguration.UnresolvablePropertyException
base
- the string to resolveseen
- strings already seen during this lookup, used to prevent unbound recursionInstancedConfiguration.UnresolvablePropertyException
public long getLastUpdateTime()
Copyright © 2023. All Rights Reserved.