Flink 内置了一个执行计划的可是化工具。http://flink.apache.org/visualizer/index.html

代码示例

object MyApp extends App {


  private val env = StreamExecutionEnvironment.getExecutionEnvironment

  env.setParallelism(1)

  private val streamPageEvent: DataStream[String] = env.socketTextStream("localhost", 9001)
  private val streamMobileEvent: DataStream[String] = env.socketTextStream("localhost", 9002)
  private val streamServerEvent: DataStream[String] = env.socketTextStream("localhost", 9003)

  private val stream: DataStream[String] = streamPageEvent.union(streamMobileEvent,streamServerEvent)


  stream.print()

  println(env.getExecutionPlan)
}

输出json

{
    "nodes": [
        {
            "id": 1,
            "type": "Source: Socket Stream",
            "pact": "Data Source",
            "contents": "Source: Socket Stream",
            "parallelism": 1
        },
        {
            "id": 2,
            "type": "Source: Socket Stream",
            "pact": "Data Source",
            "contents": "Source: Socket Stream",
            "parallelism": 1
        },
        {
            "id": 3,
            "type": "Source: Socket Stream",
            "pact": "Data Source",
            "contents": "Source: Socket Stream",
            "parallelism": 1
        },
        {
            "id": 5,
            "type": "Sink: Print to Std. Out",
            "pact": "Data Sink",
            "contents": "Sink: Print to Std. Out",
            "parallelism": 1,
            "predecessors": [
                {
                    "id": 1,
                    "ship_strategy": "FORWARD",
                    "side": "second"
                },
                {
                    "id": 2,
                    "ship_strategy": "FORWARD",
                    "side": "second"
                },
                {
                    "id": 3,
                    "ship_strategy": "FORWARD",
                    "side": "second"
                }
            ]
        }
    ]
}

flink getExecutionPlan 执行计划可视化

相关文章:

  • 2021-11-10
  • 2021-04-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2021-12-02
  • 2021-07-15
  • 2021-05-30
  • 2021-08-05
  • 2022-03-04
  • 2021-11-01
  • 2022-12-23
相关资源
相似解决方案