@NotThreadSafe public class AlluxioProperties extends Object
Configuration
class is supposed to handle the type conversion on top of the source
of truth of the properties.
For a given property key, the order of preference of its value is (from highest to lowest)
(1) runtime config
(2) system properties,
(3) properties in the specified file (site-properties),
(4) default property values.Constructor and Description |
---|
AlluxioProperties()
Constructs a new instance of Alluxio properties.
|
AlluxioProperties(AlluxioProperties alluxioProperties) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all existing user-specified properties.
|
AlluxioProperties |
copy()
Makes a copy of the backing properties and returns them in a new object.
|
Set<Map.Entry<PropertyKey,Object>> |
entrySet() |
void |
forEach(java.util.function.BiConsumer<? super PropertyKey,? super Object> action)
Iterates over all the key value pairs and performs the given action.
|
Object |
get(PropertyKey key) |
long |
getLastUpdateTime() |
Source |
getSource(PropertyKey key) |
String |
hash() |
boolean |
isSet(PropertyKey key)
Checks if there is a value set for the given key.
|
boolean |
isSetByUser(PropertyKey key) |
Set<PropertyKey> |
keySet() |
void |
merge(AlluxioProperties properties)
Merges properties from another instance.
|
void |
merge(Map<?,?> properties,
Source source)
Merges the current configuration properties with new properties.
|
void |
put(PropertyKey key,
Object value,
Source source)
Puts the key value pair specified by users.
|
void |
remove(PropertyKey key)
Remove the value set for key.
|
void |
set(PropertyKey key,
Object value)
Puts the key value pair specified by users.
|
void |
setSource(PropertyKey key,
Source source)
Sets the source for a given key.
|
Set<PropertyKey> |
userKeySet() |
public AlluxioProperties()
public AlluxioProperties(AlluxioProperties alluxioProperties)
alluxioProperties
- properties to copy@Nullable public Object get(PropertyKey key)
key
- the key to querypublic void clear()
public void put(PropertyKey key, Object value, Source source)
key
- key to putvalue
- value to putsource
- the source of this value for the keypublic void set(PropertyKey key, Object value)
key
- key to putvalue
- value to putpublic void merge(Map<?,?> properties, Source source)
properties
- the source Properties
to be mergedsource
- the source of the the properties (e.g., system property, default and etc)public void merge(AlluxioProperties properties)
properties
- the properties to merge frompublic void remove(PropertyKey key)
key
- key to removepublic boolean isSet(PropertyKey key)
key
- the key to checkpublic boolean isSetByUser(PropertyKey key)
key
- the key to checkpublic Set<Map.Entry<PropertyKey,Object>> entrySet()
public Set<PropertyKey> keySet()
public Set<PropertyKey> userKeySet()
public void forEach(java.util.function.BiConsumer<? super PropertyKey,? super Object> action)
action
- the operation to perform on each key value pairpublic AlluxioProperties copy()
public void setSource(PropertyKey key, Source source)
key
- property keysource
- the sourcepublic Source getSource(PropertyKey key)
key
- property keypublic String hash()
public long getLastUpdateTime()
Copyright © 2023. All Rights Reserved.