public static Plan getConnectedComponentsCoGroupPlan() { // prepare the test environment PreviewPlanEnvironment env = new PreviewPlanEnvironment(); env.setAsContext(); try { connectedComponentsWithCoGroup(new String[]{DEFAULT_PARALLELISM_STRING, IN_FILE, IN_FILE, OUT_FILE, "100"}); } catch (ProgramAbortException pae) { // all good. } catch (Exception e) { e.printStackTrace(); Assert.fail("connectedComponentsWithCoGroup failed with an exception"); } return env.getPlan(); }
@Override public JobExecutionResult execute(String jobName) throws Exception { this.plan = createProgramPlan(jobName); this.previewPlan = Optimizer.createPreOptimizedPlan(plan); // do not go on with anything now! throw new OptimizerPlanEnvironment.ProgramAbortException(); }
public void setAsContext() { ExecutionEnvironmentFactory factory = new ExecutionEnvironmentFactory() { @Override public ExecutionEnvironment createExecutionEnvironment() { return PreviewPlanEnvironment.this; } }; initializeContextEnvironment(factory); }
PreviewPlanEnvironment env = new PreviewPlanEnvironment(); env.setAsContext(); try { invokeInteractiveModeForExecution(); env.unsetAsContext();
@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(); } }
public void unsetAsContext() { resetContextEnvironment(); }
@Test(expected = OptimizerPlanEnvironment.ProgramAbortException.class, timeout = 30_000) public void testPlanningOfLargePlan() throws Exception { runProgram(new PreviewPlanEnvironment(), 10, 20); }
PreviewPlanEnvironment env = new PreviewPlanEnvironment(); env.setAsContext(); try { invokeInteractiveModeForExecution(); env.unsetAsContext();
@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(); } }
public void unsetAsContext() { resetContextEnvironment(); }
public static Plan getKMeansPlan() { // prepare the test environment PreviewPlanEnvironment env = new PreviewPlanEnvironment(); env.setAsContext(); try { kmeans(new String[]{IN_FILE, IN_FILE, OUT_FILE, "20"}); } catch (OptimizerPlanEnvironment.ProgramAbortException pae) { // all good. } catch (Exception e) { e.printStackTrace(); Assert.fail("KMeans failed with an exception"); } return env.getPlan(); }
PreviewPlanEnvironment env = new PreviewPlanEnvironment(); env.setAsContext(); try { invokeInteractiveModeForExecution(); env.unsetAsContext();
@Override public String getExecutionPlan() throws Exception { Plan plan = createProgramPlan("unused"); this.previewPlan = Optimizer.createPreOptimizedPlan(plan); // do not go on with anything now! throw new OptimizerPlanEnvironment.ProgramAbortException(); }
public void setAsContext() { ExecutionEnvironmentFactory factory = new ExecutionEnvironmentFactory() { @Override public ExecutionEnvironment createExecutionEnvironment() { return PreviewPlanEnvironment.this; } }; initializeContextEnvironment(factory); }
@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(); } }
public void unsetAsContext() { resetContextEnvironment(); }
public static Plan getTPCH3Plan() { // prepare the test environment PreviewPlanEnvironment env = new PreviewPlanEnvironment(); env.setAsContext(); try { tcph3(new String[]{DEFAULT_PARALLELISM_STRING, IN_FILE, IN_FILE, OUT_FILE}); } catch (OptimizerPlanEnvironment.ProgramAbortException pae) { // all good. } catch (Exception e) { e.printStackTrace(); Assert.fail("tcph3 failed with an exception"); } return env.getPlan(); }
PreviewPlanEnvironment env = new PreviewPlanEnvironment(); env.setAsContext(); try { invokeInteractiveModeForExecution(); env.unsetAsContext();
@Override public JobExecutionResult executeInternal(String jobName, boolean detached) throws Exception { this.plan = createProgramPlan(jobName); this.previewPlan = Optimizer.createPreOptimizedPlan(plan); // do not go on with anything now! throw new OptimizerPlanEnvironment.ProgramAbortException(); }
public void setAsContext() { ExecutionEnvironmentFactory factory = new ExecutionEnvironmentFactory() { @Override public ExecutionEnvironment createExecutionEnvironment() { return PreviewPlanEnvironment.this; } }; initializeContextEnvironment(factory); }