Java Code Examples for org.apache.flink.api.java.utils.ParameterTool#fromSystemProperties()

The following examples show how to use org.apache.flink.api.java.utils.ParameterTool#fromSystemProperties() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExecutionEnvUtil.java    From flink-learning with Apache License 2.0 5 votes vote down vote up
private static ParameterTool createParameterTool() {
    try {
        return ParameterTool
                .fromPropertiesFile(ExecutionEnvUtil.class.getResourceAsStream(PropertiesConstants.PROPERTIES_FILE_NAME))
                .mergeWith(ParameterTool.fromSystemProperties());
    } catch (IOException e) {
        e.printStackTrace();
    }
    return ParameterTool.fromSystemProperties();
}
 
Example 2
Source File: ExecutionEnvUtil.java    From flink-learning with Apache License 2.0 5 votes vote down vote up
private static ParameterTool createParameterTool() {
    try {
        return ParameterTool
                .fromPropertiesFile(ExecutionEnvUtil.class.getResourceAsStream(PropertiesConstants.PROPERTIES_FILE_NAME))
                .mergeWith(ParameterTool.fromSystemProperties());
    } catch (IOException e) {
        e.printStackTrace();
    }
    return ParameterTool.fromSystemProperties();
}
 
Example 3
Source File: FlinkContextReference.java    From rheem with Apache License 2.0 5 votes vote down vote up
private void loadConfiguration(Configuration conf, int parallelism){
    ParameterTool tools = ParameterTool.fromSystemProperties();
    this.flinkEnviroment.getConfig().setGlobalJobParameters(tools);
    this.flinkEnviroment.setParallelism(parallelism);

    ExecutionMode mode = getExecutionMode(conf.getStringProperty("rheem.flink.mode.execution"));

    this.flinkEnviroment.getConfig().setExecutionMode(mode);
}