当前位置:网站首页>深入浅出总结Flink运行时架构
深入浅出总结Flink运行时架构
2022-06-29 09:38:00 【InfoQ】
一、Flink运行时各个组件介绍
作业管理器(JobManager)资源管理器(ResourceManager)任务管理器(TaskManager)分发器(Dispatcher)二、Flink任务提交的流程


- Client 为提交 Job 的客户端,可以是运行在任何机器上(与 JobManager 环境连通即可)。提交 Job 后,Client 可以结束进程(Streaming 的任务),也可以不结束并等待结果返回。
- JobManager 主 要 负 责 调 度 Job 并 协 调 Task 做 checkpoint, 职 责 上 很 像Storm 的 Nimbus。从 Client 处接收到 Job 和 JAR 包等资源后,会生成优化后的执行计划,并以 Task 的单元调度到各个 TaskManager 去执行。
- TaskManager 在启动的时候就设置好了槽位数(Slot),每个 slot 能启动一个Task,Task 为线程。从 JobManager 处接收需要部署的 Task,部署启动后,与自己的上游建立 Netty 连接,接收数据并处理
三、Flink任务调度原理

- 一个 Worker(TaskManager)就是一个 JVM 进程,内部拥有一个或多个 Task Slot 进一步细分进程的 CPU 资源。
- Slot 是指 TaskManager 最大能并发执行的能力->taskmanager.numberOfTaskSlots->ys
- parallelism 是指 TaskManager 实际使用的并发能力->parallelism.default->p
- 同一Slot 中的线程共享相同的 JVM。 同一 JVM 中的任务共享 TCP 连接和心跳消息。TaskManager 的一个 Slot 代表一个可用线程,该线程具有固定的内存,注意 Slot 只对内存隔离,没有对 CPU 隔离

- 所有的 Flink 程序都是由三部分组成的: Source 、Transformation 和 Sink。Source 负责读取数据源,Transformation 利用各种算子进行处理加工,Sink 负责输出。
- Flink 上运行的程序会被映射成“逻辑数据流”(dataflows),它包含了这三部分。每一个 dataflow 以一个或多个 sources 开始以一个或多个 sinks 结束。dataflow 类似于任意的有向无环图(DAG)。
- 程序中的转换运算(transformations)跟 dataflow 中的(operator)是一一对应的关系,但有时候,一个 transformation 可能对应多个 operator。

- One-to-one:stream(比如在 source 和 map operator 之间)维护着分区以及元素的顺序。那意味着 map 算子的子任务看到的元素的个数以及顺序跟 source 算子的子任务生产的元素的个数、顺序相同,map、fliter、flatMap 等算子都是 one-to-one 的对应关系。
- Redistributing:stream(map()跟 keyBy/window 之间或者 keyBy/window 跟 sink之间)的分区会发生改变。每一个算子的子任务依据所选择的 transformation 发送数据到不同的目标任务。例如,keyBy() 基于 hashCode 重分区、broadcast 和 rebalance会随机重新分区,这些算子都会引起 redistribute 过程

边栏推荐
- stream流(Collectors)用法
- mysql 8.0 一条insert语句的具体执行流程分析(二)
- Given the values of two integer variables, the contents of the two values are exchanged (C language)
- Is it safe to open a securities account? Is it reliable?
- BUUCTF RE-easyre
- C#中Attribute(特性)
- 解决zxing的QR码包含中文时乱码的问题
- LVGL库入门教程 - 动画
- Win32exception (0x80004005): This program is blocked by group policy. For more information, contact your system administrator.
- C#使用WinExec调用exe程序
猜你喜欢

Analysis of BlockingQueue source code of AQS

CLR via C reading notes - single instance application

Atomic explanation of AQS

如何快速完成磁盘分区

Fully understand the MESI cache consistency protocol

30岁,女,普通软件测试媛,对职业的迷茫和焦虑

Voir le classement des blogs pour csdn

BUUCTF--新年快乐

Real test = "half product + Half development"?

Reading notes of CLR via C -clr boarding and AppDomain
随机推荐
Linux下Redis安装及集群搭建
给定两个整形变量的值,将两个值的内容进行交换 (C语言)
MySQL中的alter table操作之add/modify/drop列
UserWarning: Usage of dash-separated ‘script-dir‘ will not be supported in future versions. 笔记
Agctfb partial solution
BUUCTF RE-easyre
Bug description, rating and life cycle
Common usage of LINQ in C #
Voir le classement des blogs pour csdn
BUUCTF--内涵的软件
C#中IEqualityComparer接口的实现
二叉树
The product strength is not inferior to that of BYD. Geely Dihao l Raytheon hi · x delivered 10000 units in the first month
基于STM32+RFID设计的宿舍检修管理系统
std::unique_ptr<T>与boost::scoped_ptr<T>的特殊性
C # use winexec to call exe program
《如何阅读一本书》读后总结
Buuctf-- connotative software
Call another interface button through win32API
罗清启:高端家电已成红海?卡萨帝率先破局
