Skip to content

Commit

Permalink
[FLINK-2982][cli] Fix to show streaming plans via info option.
Browse files Browse the repository at this point in the history
This closes apache#1334.
  • Loading branch information
sachingoel0101 authored and mxm committed Nov 9, 2015
1 parent ed73f66 commit 4462f53
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import org.apache.flink.optimizer.costs.DefaultCostEstimator;
import org.apache.flink.optimizer.plan.FlinkPlan;
import org.apache.flink.optimizer.plan.OptimizedPlan;
import org.apache.flink.optimizer.plan.StreamingPlan;
import org.apache.flink.optimizer.plandump.PlanJSONDumpGenerator;
import org.apache.flink.runtime.akka.AkkaUtils;
import org.apache.flink.runtime.client.JobStatusMessage;
Expand Down Expand Up @@ -415,8 +416,12 @@ protected int info(String[] args) {
this.optimizedPlan = flinkPlan;
this.packagedProgram = program;
} else {
String jsonPlan = new PlanJSONDumpGenerator()
.getOptimizerPlanAsJSON((OptimizedPlan) flinkPlan);
String jsonPlan = null;
if (flinkPlan instanceof OptimizedPlan) {
jsonPlan = new PlanJSONDumpGenerator().getOptimizerPlanAsJSON((OptimizedPlan) flinkPlan);
} else if (flinkPlan instanceof StreamingPlan) {
jsonPlan = ((StreamingPlan) flinkPlan).getStreamingPlanAsJSON();
}

if (jsonPlan != null) {
System.out.println("----------------------- Execution Plan -----------------------");
Expand Down

0 comments on commit 4462f53

Please sign in to comment.