Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 2.57 KB

execution_plans.zh.md

File metadata and controls

77 lines (56 loc) · 2.57 KB
title nav-parent_id nav-pos
Execution Plans
execution
40

Depending on various parameters such as data size or number of machines in the cluster, Flink's optimizer automatically chooses an execution strategy for your program. In many cases, it can be useful to know how exactly Flink will execute your program.

Plan Visualization Tool

Flink provides a visualization tool for execution plans, which takes a JSON representation of the job execution plan and visualizes it as a graph with complete annotations of execution strategies.

The following code shows how to print the execution plan JSON from your program:

{% highlight java %} final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

...

System.out.println(env.getExecutionPlan()); {% endhighlight %}

{% highlight scala %} val env = ExecutionEnvironment.getExecutionEnvironment

...

println(env.getExecutionPlan()) {% endhighlight %}

To visualize the execution plan, do the following:

  1. Open the visualizer with your web browser,
  2. Paste the JSON string into the text field, and
  3. Press the draw button.

After these steps, a detailed execution plan will be visualized.

A flink job execution graph.

Web Interface

Flink offers a web interface for submitting and executing jobs. The interface is part of the JobManager's web interface for monitoring, per default running on port 8081.

You may specify program arguments before the job is executed. The plan visualization enables you to show the execution plan before executing the Flink job.

{% top %}