Package org.apache.flink.configuration
Class ConfigurationFileMigrationUtils
- java.lang.Object
-
- org.apache.flink.configuration.ConfigurationFileMigrationUtils
-
public class ConfigurationFileMigrationUtils extends Object
Utility class for migrating legacy Flink configuration fileflink-conf.yaml
to the new format starting from Flink 2.0. This class provides methods to load legacy configuration files and convert them into the new configuration format.
-
-
Field Summary
Fields Modifier and Type Field Description static String
LEGACY_FLINK_CONF_FILENAME
This file is only used to help users migrate their legacy configuration files to the new configuration file `config.yaml` starting from Flink 2.0.
-
Constructor Summary
Constructors Constructor Description ConfigurationFileMigrationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,String>
loadLegacyYAMLResource(File file)
Loads a YAML-file of key-value pairs.static Configuration
migrateLegacyToStandardYamlConfig(String configDir)
Migrates the legacy Flink configuration from the specified directory to a standard YAML format representation.
-
-
-
Field Detail
-
LEGACY_FLINK_CONF_FILENAME
@VisibleForTesting public static final String LEGACY_FLINK_CONF_FILENAME
This file is only used to help users migrate their legacy configuration files to the new configuration file `config.yaml` starting from Flink 2.0.- See Also:
- Constant Field Values
-
-
Method Detail
-
migrateLegacyToStandardYamlConfig
public static Configuration migrateLegacyToStandardYamlConfig(String configDir)
Migrates the legacy Flink configuration from the specified directory to a standard YAML format representation.This method loads the legacy configuration file named
flink-conf.yaml
from the specified directory. If the file is found, it converts the legacy format into a standardConfiguration
object in YAML format.- Parameters:
configDir
- the directory where the legacy configuration file is located- Returns:
- a
Configuration
object in standard YAML format
-
loadLegacyYAMLResource
@VisibleForTesting public static Map<String,String> loadLegacyYAMLResource(File file)
Loads a YAML-file of key-value pairs.Colon and whitespace ": " separate key and value (one per line). The hash tag "#" starts a single-line comment.
Example:
jobmanager.rpc.address: localhost # network address for communication with the job manager jobmanager.rpc.port : 6123 # network port to connect to for communication with the job manager taskmanager.rpc.port : 6122 # network port the task manager expects incoming IPC connections
This does not span the whole YAML specification, but only the *syntax* of simple YAML key-value pairs (see issue #113 on GitHub). If at any point in time, there is a need to go beyond simple key-value pairs syntax compatibility will allow to introduce a YAML parser library.
- Parameters:
file
- the YAML file to read from- See Also:
- YAML 1.2 specification
-
-