有关中国文明网联盟网站建设活动方案,宠物美容网站建设的目的,网站数据库是谁提供,佛山网站建设佛山Graph 的概念
Flink 中的执行图可以分成四层#xff1a; StreamGraph - JobGraph - ExecutionGraph - 物理执 行图。
StreamGraph#xff1a;是根据用户通过 Stream API 编写的代码生成的最初的图。用来表示程序的拓扑结构。JobGraph#xff1a; StreamGraph …Graph 的概念
Flink 中的执行图可以分成四层 StreamGraph - JobGraph - ExecutionGraph - 物理执 行图。
StreamGraph是根据用户通过 Stream API 编写的代码生成的最初的图。用来表示程序的拓扑结构。JobGraph StreamGraph 经过优化后生成了 JobGraph提交给 JobManager 的数据结构。主要的优化为将多个符合条件的节点 chain 在一起作为一个节点这样可以减少数据在节点之间流动所需要的序列化/反序列化/传输消耗。ExecutionGraph JobManager 根据 JobGraph 生成 ExecutionGraph。 ExecutionGraph 是JobGraph 的并行化版本是调度层最核心的数据结构。物 理 执 行 图 JobManager 根据 ExecutionGraph 对 Job 进行调度后在各个TaskManager 上部署 Task 后形成的“图”并不是一个具体的数据结构。
WordCount举例
public static void main(String[] args) throws Exception {
// 检查输入
final ParameterTool params ParameterTool.fromArgs(args);
...
// set up the execution environment
final StreamExecutionEnvironment env StreamExecutionEnvironment.getExecutionEnvironment();
// get input data
DataStreamString text
env.socketTextStream(params.get(hostname), params.getInt(port), \n, 0);
DataStreamTuple2String, Integer counts
// split up the lines in pairs (2-tuples) containing: (word,1)
text.flatMap(new Tokenizer())
// group by the tuple field 0 and sum up tuple field 1
.keyBy(0)
.sum(1);
counts.print();
// execute program
env.execute(WordCount from SocketTextStream Example);
} StreamGraph在Client生成
分区器 JobGraph在Client生成 ExecutionGraph在JobManager生成