Package org.apache.flink.runtime.util
Class ConfigurationParserUtils
java.lang.Object
org.apache.flink.runtime.util.ConfigurationParserUtils
Utility class to extract related parameters from
Configuration and to sanity check them.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckConfigParameter(boolean condition, Object parameter, String name, String errorMessage) Validates a condition for a config parameter and displays a standard exception, if the condition does not hold.static intgetPageSize(org.apache.flink.configuration.Configuration configuration) Parses the configuration to get the page size and validates the value.static intgetSlot(org.apache.flink.configuration.Configuration configuration) Parses the configuration to get the number of slots and validates the value.loadAndModifyConfiguration(String[] args, String cmdLineSyntax) static org.apache.flink.configuration.ConfigurationloadCommonConfiguration(String[] args, String cmdLineSyntax) Generate configuration from only the config file and dynamic properties.migrateLegacyConfigurationToStandardYaml(String[] args, String cmdLineSyntax)
-
Constructor Details
-
ConfigurationParserUtils
public ConfigurationParserUtils()
-
-
Method Details
-
getSlot
public static int getSlot(org.apache.flink.configuration.Configuration configuration) Parses the configuration to get the number of slots and validates the value.- Parameters:
configuration- configuration object- Returns:
- the number of slots in task manager
-
checkConfigParameter
public static void checkConfigParameter(boolean condition, Object parameter, String name, String errorMessage) throws org.apache.flink.configuration.IllegalConfigurationException Validates a condition for a config parameter and displays a standard exception, if the condition does not hold.- Parameters:
condition- The condition that must hold. If the condition is false, an exception is thrown.parameter- The parameter value. Will be shown in the exception message.name- The name of the config parameter. Will be shown in the exception message.errorMessage- The optional custom error message to append to the exception message.- Throws:
org.apache.flink.configuration.IllegalConfigurationException- if the condition does not hold
-
getPageSize
public static int getPageSize(org.apache.flink.configuration.Configuration configuration) Parses the configuration to get the page size and validates the value.- Parameters:
configuration- configuration object- Returns:
- size of memory segment
-
loadCommonConfiguration
public static org.apache.flink.configuration.Configuration loadCommonConfiguration(String[] args, String cmdLineSyntax) throws FlinkParseException Generate configuration from only the config file and dynamic properties.- Parameters:
args- the commandline argumentscmdLineSyntax- the syntax for this application- Returns:
- generated configuration
- Throws:
FlinkParseException- if the configuration cannot be generated
-
loadAndModifyConfiguration
public static List<String> loadAndModifyConfiguration(String[] args, String cmdLineSyntax) throws FlinkParseException - Throws:
FlinkParseException
-
migrateLegacyConfigurationToStandardYaml
public static List<String> migrateLegacyConfigurationToStandardYaml(String[] args, String cmdLineSyntax) throws FlinkParseException - Throws:
FlinkParseException
-