public class ConfigurationUtils extends Object
Configuration
related helper functions.Modifier and Type | Method and Description |
---|---|
static Configuration |
createConfiguration(Properties properties)
Creates a new
Configuration from the given Properties . |
static Map<String,String> |
getPrefixedKeyValuePairs(String prefix,
Configuration configuration)
Extract and parse Flink configuration properties with a given name prefix and return the
result as a Map.
|
static Time |
getStandaloneClusterStartupPeriodTime(Configuration configuration) |
static Optional<Time> |
getSystemResourceMetricsProbingInterval(Configuration configuration) |
static Map<String,String> |
hideSensitiveValues(Map<String,String> keyValuePairs)
Replaces values whose keys are sensitive according to
GlobalConfiguration.isSensitive(String) with GlobalConfiguration.HIDDEN_CONTENT . |
static Map<String,String> |
parseJvmArgString(String jvmParamsStr) |
static String[] |
parseLocalStateDirectories(Configuration configuration)
Extracts the local state directories as defined by
CheckpointingOptions.LOCAL_RECOVERY_TASK_MANAGER_STATE_ROOT_DIRS . |
static Map<String,String> |
parseMap(String stringSerializedMap)
Parses a string as a map of strings.
|
static String[] |
parseTempDirectories(Configuration configuration)
Extracts the task manager directories for temporary files as defined by
CoreOptions.TMP_DIRS . |
static Map<String,String> |
parseTmResourceDynamicConfigs(String dynamicConfigsStr) |
static String[] |
splitPaths(String separatedPaths) |
public static Optional<Time> getSystemResourceMetricsProbingInterval(Configuration configuration)
MetricOptions.SYSTEM_RESOURCE_METRICS_PROBING_INTERVAL
or Optional.empty()
if MetricOptions.SYSTEM_RESOURCE_METRICS
are disabled.@Nonnull public static String[] parseTempDirectories(Configuration configuration)
CoreOptions.TMP_DIRS
.configuration
- configuration object@Nonnull public static String[] parseLocalStateDirectories(Configuration configuration)
CheckpointingOptions.LOCAL_RECOVERY_TASK_MANAGER_STATE_ROOT_DIRS
.configuration
- configuration objectpublic static Map<String,String> parseMap(String stringSerializedMap)
key1:value1,key2:value2
Parts of the string can be escaped by wrapping with single or double quotes.
stringSerializedMap
- a string to parsepublic static Time getStandaloneClusterStartupPeriodTime(Configuration configuration)
@Nonnull public static Configuration createConfiguration(Properties properties)
Configuration
from the given Properties
.properties
- to convert into a Configuration
Configuration
which has been populated by the values of the given Properties
@Nonnull public static Map<String,String> hideSensitiveValues(Map<String,String> keyValuePairs)
GlobalConfiguration.isSensitive(String)
with GlobalConfiguration.HIDDEN_CONTENT
.
This can be useful when displaying configuration values.
keyValuePairs
- for which to hide sensitive values@VisibleForTesting public static Map<String,String> parseTmResourceDynamicConfigs(String dynamicConfigsStr)
@VisibleForTesting public static Map<String,String> parseJvmArgString(String jvmParamsStr)
public static Map<String,String> getPrefixedKeyValuePairs(String prefix, Configuration configuration)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.