use of org.apache.flink.runtime.entrypoint.ClusterConfigurationParserFactory in project flink by apache.
the class ConfigurationParserUtils method loadCommonConfiguration.
/**
* Generate configuration from only the config file and dynamic properties.
*
* @param args the commandline arguments
* @param cmdLineSyntax the syntax for this application
* @return generated configuration
* @throws FlinkParseException if the configuration cannot be generated
*/
public static Configuration loadCommonConfiguration(String[] args, String cmdLineSyntax) throws FlinkParseException {
final CommandLineParser<ClusterConfiguration> commandLineParser = new CommandLineParser<>(new ClusterConfigurationParserFactory());
final ClusterConfiguration clusterConfiguration;
try {
clusterConfiguration = commandLineParser.parse(args);
} catch (FlinkParseException e) {
LOG.error("Could not parse the command line options.", e);
commandLineParser.printHelp(cmdLineSyntax);
throw e;
}
final Configuration dynamicProperties = ConfigurationUtils.createConfiguration(clusterConfiguration.getDynamicProperties());
return GlobalConfiguration.loadConfiguration(clusterConfiguration.getConfigDir(), dynamicProperties);
}
Aggregations