您能帮我理解这段摘录吗?摘自 Kafka Streams documentation :
Within a stream task that may be processing multiple topic-partitions, if users configure the application to not wait for all partitions to contain some buffered data and pick from the partition with the smallest timestamp to process the next record, then later on when some records are fetched for other topic-partitions, their timestamps may be smaller than those processed records fetched from another topic-partition.
我不明白其中的逻辑:如果你选择时间戳最小的分区,为什么稍后会得到更小的时间戳?
最佳答案
我认为重要的部分是
if users configure the application to not wait for all partitions to contain some buffered data
由于我们不等待所有分区都有一些数据,因此流 S1
和 S2
(T1
<T2
):
I2
(带有时间戳T2
)到达S2
- 由于没有其他可用数据,流读取
I2
I1
时间戳为T1
到达S1
- 流读取
I1
,其时间戳小于已处理的I2
如果我们等到所有流都有数据,我们将从所有可用项目中选择最小的项目。由于我们不这样做,因此时间戳较小的项目可能会被延迟。
关于apache-kafka - Kafka Streams中数据乱序原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59330154/