Ordering of Records in Stream

后端 未结 2 1272
失恋的感觉
失恋的感觉 2021-01-15 05:53

Here are some of the queries I have :

I have two different streams stream1 and stream2 in which the elements are in order.

1) Now

2条回答
  •  有刺的猬
    2021-01-15 06:57

    Concerning Ordering Guarantees

    This page gives a good overview and explanation, also of ordering guarantees: https://ci.apache.org/projects/flink/flink-docs-release-1.0/concepts/concepts.html#parallel-dataflows

    The Gist is:

    Order is maintained within each parallel stream partition. For an explanation of stream partitions, see here: https://ci.apache.org/projects/flink/flink-docs-release-1.0/concepts/concepts.html#parallel-dataflows

    For operations like "keyBy()" or "rebalance()" that change the partitioning, the order is maintained per pair of source and target stream partition, meaning per pair of sending and receiving operator.

    As Matthias mentioned, if a group (defined by a key, running on one receiving target operator) gets elements from multiple senders, there is no well defined strict ordering of elements. Using concepts like event time, you can impose a meaningful ordering based on the data (the attached timestamps).

提交回复
热议问题