【持续更新】重要FLIP总结

news/2024/9/27 17:29:26

FLIP-27: Refactor Source Interface

流批一体API
1、解耦SplitEnumerator与SplitReader
SplitEnumerator:发现并分配splits(比如files/kafka_partitions)
SourceReader:从splits里实际读取数据
这样就使不同的splits分配策略与读取动作解耦,可分别封装成两个组件,Source接口即变成构建SplitEnumerator、SourceReader的工厂。而且降低chkpt锁竞争
0
2、流批统一
每个Source实例都可作为batch、stream source,Boundedness有界性作为Source实例的内在属性,只有SplitEnumerators应该知道有界性,reader不用知道
FileSource:对于有界输入使用SplitEnumerator一次性枚举给定目录下的所有文件,对于流输入使用SplitEnumerator定期枚举给定目录下的所有文件并分配新文件
KafkaSource:对于有界输入使用SplitEnumerator找到所有分区并将每个分区的最新offset作为split的end offset;对于无界输入使用SplitEnumerator找到所有分区且将LONG_MAX作为split的end offset,若开启自动发现分析则定期枚举所有分区
3、顶层公用接口
  • Source - A factory style class that helps create SplitEnumerator and SourceReader at runtime. 也感知Boundedness
  • SourceSplit - An interface for all the split types.
  • SplitEnumerator - Discover the splits and assign them to the SourceReaders
  • SplitEnumeratorContext - Provide necessary information to the SplitEnumerator to assign splits and send custom events to the the SourceReaders.
  • SplitAssignment - A container class holding the source split assignment for each subtask.
  • SourceReader - Read the records from the splits assigned by the SplitEnumerator.
  • SourceReaderContext - Provide necessary function to the SourceReader to communicate with SplitEnumerator.
  • SourceOutput - A collector style interface to take the records and timestamps emit by the SourceReader.
  • WatermarkOutput - An interface for emitting watermark and indicate idleness of the source.
  • Watermark - A new Watermark class will be created in the package org.apache.flink.api.common.eventtime. This class will eventually replace the existing Watermark in org.apache.flink.streaming.api.watermark. This change allows flink-core to remain independent of other modules. Given that we will eventually put all the watermark generation into the Source, this change will be necessary. Note that this FLIP does not intended to change the existing way that watermark can be overridden in the DataStream after they are emitted by the source.

FLIP-147: Support Checkpoints After Tasks Finished

流批一体runtime
在流批一体场景下,若runtime层不支持部分task结束后继续做chkpt,则会有以下问题:
  • 有界与无界输入混合的情况下,一旦发生failover会产生较大的回退开销
  • 两阶段提交的sink依赖于chkpt实现端到端一致性,若结束的这部分task不提交chkpt会无法提交数据,无法保证一致性
 

对chkpt整体流程进行修改,首先将那些前序任务都已经终止但本身尚未终止的 task 识别为新的source task,然后从这些task开始发送barrier进行正常的chkpt操作。由于 checkpoint 中 state 是以 jobvertext 为单位进行记录的,因此如果一个 jobvertext 中所有 task 都已结束,会在它的状态中记录一个特殊的标记 ver,如果是部分 task 结束,会保留所有正在运行的 task state 作为 jobvertext state,而所有其他 jobvertext 的处理流程与正常 checkpoint 保持一致。作业发生 failover 重启之后,会跳过完全终止的 jobvertext,对其他的 task 的处理逻辑与正常的处理逻辑保持一致的

 为了支持drain模式下也能等待savepoint完成、或正常结束的任务等待下一个chkpt完成后再结束,先通知所有 task EndOfDataEvent 进行结束但不关闭网络链接,等所有 task 结束之后,若是drain模式还要再发起一个 savepoint 操作,然后等待下一个chkpt或savepoint,等到之后再接收EndOfPartitionEvent关闭网络链接,就能实现所有 task 等待最后同一个 savepoint 或 chkpt而结束

对之前比较有歧义的 close() 和 dipose() 操作进行了重命名,分别改成了 finish() 和 close(),其中 finish() 只会在任务正常结束时进行调用,而 close() 会在作业正常结束和异常结束的时候都进行调用
 

FLIP-150: Introduce Hybrid Source

流批一体API
 

FLIP-95: New TableSource and TableSink interfaces

流批一体runtime
公用接口
Main interfaces:
  • DynamicTableSource
  • ScanTableSource extends DynamicTableSource
  • LookupTableSource extends DynamicTableSource
  • DynamicTableSink
Corresponding factory interfaces:
  • Factory
  • DynamicTableFactory extends Factory
  • DynamicTableSourceFactory extends DynamicTableFactory
  • DynamicTableSinkFactory extends DynamicTableFactory
  • FormatFactory extends Factory
Optional interfaces that add further abilities:
  • SupportsComputedColumnPushDown
  • SupportsFilterPushDown
  • SupportsProjectionPushDown
  • SupportsWatermarkPushDown
  • SupportsLimitPushDown
  • SupportsPartitionPushDown
  • SupportsPartitioning
  • SupportsOverwriting
Data structure interfaces and classes:
  • RowData
  • ArrayData
  • MapData
  • StringData
  • DecimalData
  • TimestampData
  • RawValueData
  • GenericRowData implements RowData
  • GenericArrayData implements ArrayData
  • GenericMapData implements MapData
 

FLIP-131: Consolidate the user-facing Dataflow SDKs/APIs (and deprecate the DataSet API)

建议用户使用DataStream/Table/SQL而逐步废弃DataSet。其实在此提出前DataStream在功能上已经能覆盖DataSet的功能,只是执行批处理效率欠佳,而Table/SQL则完全能高效处理流批数据。这个提议只是明确这个批是流特殊情况的理念,并在DataSet文档里加上了建议用户使用DataStream
 

FLIP-188: Introduce Built-in Dynamic Table Storage

流批一体存储
 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ryyt.cn/news/45916.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

Java-HashMap中put源码解读

1.背景Map类型 优点 缺点 线程安全性HashMap 1. 查询、插入、删除操作的时间复杂度为O(1)。2. 允许键和值为null。 1. 无序,不保证迭代顺序。2. 不是线程安全的。 LinkedHashMap 1. 保留插入顺序或访问顺序。2. 与HashMap性能相似。 1. 内存开销较高,因为维护了一个双向链表。…

大模型显存计算

大模型微调需要多少GPU显存?如:微调 1B 模型,16bit = 2byte全量微调显存占用分为:model weight(参数本身):10亿(bit) = 20亿(byte)约等于2GB训练模型时,通过一系列反向传播的方法,来更新模型参数,涉及以下gradient​和optimizer states​参数。不断计算梯度,以更…

一图看懂编码,加密,令牌化的不同之处

一图看懂编码,加密,令牌化的不同之处

解决HBuilder X识别不了魅族手机的问题

似乎魅族手机有点特别,别的手机识别没事,但是到了魅族手机就是识别不了,下面上处理方案 这里假设你的调试已经打开的情况下, 找到目录C:\Users\tutu-qiuxie\Downloads\HBuilderX\plugins\launcher-tools\tools\adbs先把软件关闭, 打开HbuilderX后,记得手机上弹出的是否允…

[模式识别复习笔记] 第5章 贝叶斯分类器

1. 贝叶斯分类器 1.1 贝叶斯公式 假设有一个试验的样本空间为 \(S\),记 \(B_1, B_2, \ldots, B_c\) 为 \(S\) 的一个划分,\(A\) 为试验的条件,且 \(P(A) \not = 0\),则: \[P(B_i | A) = \frac{P(B_i)P(A|B_i)}{P(A)} = \frac{P(B_i)P(A|B_i)}{\sum_{j=1}^{c}P(B_j)P(A|B_j…

Windows删除服务

删除的是文件管理器里的服务 如何进入右击此电脑,选择管理(没看到管理的话点击显示更多选项) 进入计算机管理进入计算机管理后选择服务和应用程序 双击服务 要删除的就是这里的服务——————————如何删除 参考—— https://www.sysgeek.cn/windows-delete-service/以…

你不知道的 CSS 之包含块

你不知道的 CSS 之包含块 一说到 CSS 盒模型,这是很多小伙伴耳熟能详的知识,甚至有的小伙伴还能说出 border-box 和 content-box 这两种盒模型的区别。 但是一说到 CSS 包含块,有的小伙伴就懵圈了,什么是包含块?好像从来没有听说过这玩意儿。好吧,如果你对包含块的知识一…

《深入理解计算机系统》

深入理解计算机系统读书先看书之序言:明确他面向的读者——本书是一个导论课本,是面向程序员的,所以并不是那么深入(因为程序员也不需要了解那么多)所以这对于初学者来说是比较容易的,合适的入门之选第一章:计算机系统漫游相当于是一个粗略的介绍,导言,但是短小精干1.…