public class BootstrapTools extends Object
Modifier and Type | Method and Description |
---|---|
static Configuration |
cloneConfiguration(Configuration configuration)
Clones the given configuration and resets instance specific config options.
|
static String |
escapeForDifferentOS(String value)
Escape all the dynamic property values.
|
static String |
escapeWithDoubleQuote(String value) |
static String |
escapeWithSingleQuote(String value) |
static String |
getDynamicPropertiesAsString(Configuration baseConfig,
Configuration targetConfig)
Get dynamic properties based on two Flink configurations.
|
static org.apache.commons.cli.Option |
newDynamicPropertiesOption()
Get an instance of the dynamic properties option.
|
static Configuration |
parseDynamicProperties(org.apache.commons.cli.CommandLine cmd)
Parse the dynamic properties (passed on the command line).
|
static void |
substituteDeprecatedConfigKey(Configuration config,
String deprecated,
String designated)
Sets the value of a new config key to the value of a deprecated config key.
|
static void |
substituteDeprecatedConfigPrefix(Configuration config,
String deprecatedPrefix,
String designatedPrefix)
Sets the value of a new config key to the value of a deprecated config key.
|
static void |
updateTmpDirectoriesInConfiguration(Configuration configuration,
String defaultDirs)
Set temporary configuration directories if necessary.
|
static void |
writeConfiguration(Configuration cfg,
File file)
Writes a Flink YAML config file from a Flink Configuration object.
|
public static void writeConfiguration(Configuration cfg, File file) throws IOException
cfg
- The Flink configfile
- The File to write toIOException
public static void substituteDeprecatedConfigKey(Configuration config, String deprecated, String designated)
config
- Config to writedeprecated
- The old config keydesignated
- The new config keypublic static void substituteDeprecatedConfigPrefix(Configuration config, String deprecatedPrefix, String designatedPrefix)
config
- Config to writedeprecatedPrefix
- Old prefix of keydesignatedPrefix
- New prefix of keypublic static org.apache.commons.cli.Option newDynamicPropertiesOption()
Dynamic properties allow the user to specify additional configuration values with -D, such as -Dfs.overwrite-files=true -Dtaskmanager.memory.network.min=536346624
public static Configuration parseDynamicProperties(org.apache.commons.cli.CommandLine cmd)
public static void updateTmpDirectoriesInConfiguration(Configuration configuration, @Nullable String defaultDirs)
configuration
- flink config to patchdefaultDirs
- in case no tmp directories is set, next directories will be appliedpublic static Configuration cloneConfiguration(Configuration configuration)
configuration
- to clonepublic static String getDynamicPropertiesAsString(Configuration baseConfig, Configuration targetConfig)
baseConfig
- The base configuration.targetConfig
- The target configuration.public static String escapeForDifferentOS(String value)
For Windows OS, each value will be surrounded with double quotes. The double quote itself needs to be escaped with back slash. Also the caret symbol need to be escaped with double carets since Windows uses it to escape characters. See https://en.wikibooks.org/wiki/Windows_Batch_Scripting for more information about Windows escaping.
value
- value to be escapedCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.