@Override public void dumpStreamingPlanAsJSON(File file) throws IOException { PrintWriter pw = null; try { pw = new PrintWriter(new FileOutputStream(file), false); pw.write(getStreamingPlanAsJSON()); pw.flush(); } finally { if (pw != null) { pw.close(); } } } }
/** * Creates the plan with which the system will execute the program, and * returns it as a String using a JSON representation of the execution data * flow graph. Note that this needs to be called, before the plan is * executed. * * @return The execution plan of the program, as a JSON String. */ public String getExecutionPlan() { return getStreamGraph().getStreamingPlanAsJSON(); }
@Override public JobExecutionResult execute(String jobName) throws Exception { StreamGraph streamGraph = getStreamGraph(); streamGraph.setJobName(jobName); transformations.clear(); if (env instanceof OptimizerPlanEnvironment) { ((OptimizerPlanEnvironment) env).setPlan(streamGraph); } else if (env instanceof PreviewPlanEnvironment) { ((PreviewPlanEnvironment) env).setPreview(streamGraph.getStreamingPlanAsJSON()); } throw new OptimizerPlanEnvironment.ProgramAbortException(); } }
/** * Tests that the json generated by JSONGenerator shall meet with 2 requirements: * 1. sink nodes are at the back * 2. if both two nodes are sink nodes or neither of them is sink node, then sort by its id. */ @Test public void testSinkIdComparison() { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); DataStream<Integer> source = env.fromElements(1, 2, 3); for (int i = 0; i < 32; i++) { if (i % 2 == 0) { source.addSink(new SinkFunction<Integer>() { @Override public void invoke(Integer value, Context ctx) throws Exception {} }); } else { source.map(x -> x + 1); } } // IllegalArgumentException will be thrown without FLINK-9216 env.getStreamGraph().getStreamingPlanAsJSON(); }
@Override public void dumpStreamingPlanAsJSON(File file) throws IOException { PrintWriter pw = null; try { pw = new PrintWriter(new FileOutputStream(file), false); pw.write(getStreamingPlanAsJSON()); pw.flush(); } finally { if (pw != null) { pw.close(); } } } }
@Override public void dumpStreamingPlanAsJSON(File file) throws IOException { PrintWriter pw = null; try { pw = new PrintWriter(new FileOutputStream(file), false); pw.write(getStreamingPlanAsJSON()); pw.flush(); } finally { if (pw != null) { pw.close(); } } } }
@Override public void dumpStreamingPlanAsJSON(File file) throws IOException { PrintWriter pw = null; try { pw = new PrintWriter(new FileOutputStream(file), false); pw.write(getStreamingPlanAsJSON()); pw.flush(); } finally { if (pw != null) { pw.close(); } } } }
/** * Creates the plan with which the system will execute the program, and * returns it as a String using a JSON representation of the execution data * flow graph. Note that this needs to be called, before the plan is * executed. * * @return The execution plan of the program, as a JSON String. */ public String getExecutionPlan() { return getStreamGraph().getStreamingPlanAsJSON(); }
/** * Creates the plan with which the system will execute the program, and * returns it as a String using a JSON representation of the execution data * flow graph. Note that this needs to be called, before the plan is * executed. * * @return The execution plan of the program, as a JSON String. */ public String getExecutionPlan() { return getStreamGraph().getStreamingPlanAsJSON(); }
/** * Creates the plan with which the system will execute the program, and * returns it as a String using a JSON representation of the execution data * flow graph. Note that this needs to be called, before the plan is * executed. * * @return The execution plan of the program, as a JSON String. */ public String getExecutionPlan() { return getStreamGraph().getStreamingPlanAsJSON(); }
/** * Creates the plan with which the system will execute the program, and * returns it as a String using a JSON representation of the execution data * flow graph. Note that this needs to be called, before the plan is * executed. * * @return The execution plan of the program, as a JSON String. */ public String getExecutionPlan() { return getStreamGraph().getStreamingPlanAsJSON(); }
@Override public JobExecutionResult execute(String jobName) throws Exception { StreamGraph streamGraph = getStreamGraph(); streamGraph.setJobName(jobName); transformations.clear(); if (env instanceof OptimizerPlanEnvironment) { ((OptimizerPlanEnvironment) env).setPlan(streamGraph); } else if (env instanceof PreviewPlanEnvironment) { ((PreviewPlanEnvironment) env).setPreview(streamGraph.getStreamingPlanAsJSON()); } throw new OptimizerPlanEnvironment.ProgramAbortException(); } }
@Override public JobExecutionResult execute(String jobName) throws Exception { StreamGraph streamGraph = getStreamGraph(); streamGraph.setJobName(jobName); transformations.clear(); if (env instanceof OptimizerPlanEnvironment) { ((OptimizerPlanEnvironment) env).setPlan(streamGraph); } else if (env instanceof PreviewPlanEnvironment) { ((PreviewPlanEnvironment) env).setPreview(streamGraph.getStreamingPlanAsJSON()); } throw new OptimizerPlanEnvironment.ProgramAbortException(); } }
@Override public JobExecutionResult execute(String jobName) throws Exception { StreamGraph streamGraph = getStreamGraph(); streamGraph.setJobName(jobName); transformations.clear(); if (env instanceof OptimizerPlanEnvironment) { ((OptimizerPlanEnvironment) env).setPlan(streamGraph); } else if (env instanceof PreviewPlanEnvironment) { ((PreviewPlanEnvironment) env).setPreview(streamGraph.getStreamingPlanAsJSON()); } throw new OptimizerPlanEnvironment.ProgramAbortException(); } }