Skip to content

Commit f02d651

Browse files
committed
fix typo StreamExection to StreamExecution
1 parent 917f992 commit f02d651

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Structured Streaming 源码解析系列/2.1 Structured Streaming 之 Source 解析.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ trait Source {
4545

4646
![Spark 1.0](1.imgs/110.png)
4747

48-
1. 在每个 StreamExection 的批次最开始,StreamExection 会向 Source 询问当前 Source 的最新进度,即最新的 offset
48+
1. 在每个 StreamExecution 的批次最开始,StreamExecution 会向 Source 询问当前 Source 的最新进度,即最新的 offset
4949
- 这里是由 StreamExecution 调用 Source 的 `def getOffset: Option[Offset]`,即方法 (2)
5050
- Kafka (KafkaSource) 的具体 `getOffset()` 实现 ,会通过在 driver 端的一个长时运行的 consumer 从 kafka brokers 处获取到各个 topic 最新的 offsets(注意这里不存在 driver 或 consumer 直接连 zookeeper),比如 `topicA_partition1:300, topicB_partition1:50, topicB_partition2:60`,并把 offsets 返回
5151
- HDFS-compatible file system (FileStreamSource) 的具体 `getOffset()` 实现,是先扫描一下最新的一组文件,给一个递增的编号并持久化下来,比如 `2 -> {c.txt, d.txt}`,然后把编号 `2` 作为最新的 offset 返回
52-
2. 这个 Offset 给到 StreamExection 后会被 StreamExection 持久化到自己的 WAL 里
53-
3. 由 Source 根据 StreamExection 所要求的 start offset、end offset,提供在 `(start, end]` 区间范围内的数据
52+
2. 这个 Offset 给到 StreamExecution 后会被 StreamExecution 持久化到自己的 WAL 里
53+
3. 由 Source 根据 StreamExecution 所要求的 start offset、end offset,提供在 `(start, end]` 区间范围内的数据
5454
- 这里是由 StreamExecution 调用 Source 的 `def getBatch(start: Option[Offset], end: Offset): DataFrame`,即方法 (3)
5555
- 这里的 start offset 和 end offset,通常就是 Source 在上一个执行批次里提供的最新 offset,和 Source 在这个批次里提供的最新 offset;但需要注意区间范围是 ***左开右闭***
5656
- 数据的返回形式的是一个 DataFrame(这个 DataFrame 目前只包含数据的描述信息,并没有发生实际的取数据操作)

0 commit comments

Comments
 (0)