use of org.apache.flink.api.java.RemoteEnvironment in project flink by apache.
the class CustomInputSplitProgram method main.
public static void main(String[] args) throws Exception {
final String[] jarFile = (args[0].equals("")) ? null : new String[] { args[0] };
final URL[] classpath = (args[1].equals("")) ? null : new URL[] { new URL(args[1]) };
final String host = args[2];
final int port = Integer.parseInt(args[3]);
final int parallelism = Integer.parseInt(args[4]);
RemoteEnvironment env = new RemoteEnvironment(host, port, null, jarFile, classpath);
env.setParallelism(parallelism);
env.getConfig().disableSysoutLogging();
DataSet<Integer> data = env.createInput(new CustomInputFormat());
data.map(new MapFunction<Integer, Tuple2<Integer, Double>>() {
@Override
public Tuple2<Integer, Double> map(Integer value) {
return new Tuple2<Integer, Double>(value, value * 0.5);
}
}).output(new DiscardingOutputFormat<Tuple2<Integer, Double>>());
env.execute();
}
Aggregations