Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-1967] Introduce (Event)time in Streaming
This introduces an additional timestamp field in StreamRecord. When using a SourceFunction and an auto-timestamp interval is set using the ExecutionConfig, the timestamp is automatically set to System.currentTimeMillis() upon element emission. The timestamp can be manually set using an EventTimeSourceFunction. This also changes the signature of the StreamOperators. They now get a StreamRecord instead of the unwrapped value. This is necessary for them to access the timestamp. Before, the StreamTask would unwrap the value from the StreamRecord, now this is moved one layer higher. This also introduces watermarks to keep track of processing. At a configurable interval the sources will emit watermarks that signify that no records with a lower timestamp will be emitted in the future by this source. The timestamps are broadcast, stream inputs wait for watermark events on all input channels and forward the watermark to the StreamOperator once the watermark advances on all inputs. Operators are responsible for forwarding the watermark once they know that no elements with a previous timestamp will be emitted (this is mostly relevant for buffering operations such as windows). Right now, all operators simply forward the watermark they receive. When using an EventTimeSourceFunction the system does not automatically emit timestamps, the user is required to manually emit watermarks using the SourceContext. No watermarks will be emitted unless ExecutionConfig.setAutoWatermarkInterval is used to set a watermark interval. Per default timestamps and watermarks are completely disabled, there is a switch in ExecutionConfig (enableTimstamps()) to enable them. This means that, out-of-box, the performance is not changed by adding this new feature. If it is not used. This commit contains fixes for other stuff that was discovered while implementing the feature. See Jira issue numbers and descriptions below. [FLINK-2290/2295] Fix CoReader Event Handling and Checkpointing This changes CoReader (now CoStreamingRecordReader) to reuse UnionGate for the input multiplexing. This way it will not lock in on one specific input side and read events from both input sides. This also enables an event listener for checkpoint barriers so that the TwoInputTask now reacts to those and correctly forwards them. Then, this adds CoStreamCheckpointintITCase to verify that checkpointing works in topologies with TwoInputStreamTasks. This also adds tests for OneInputStreamTask and TwoInputStreamTask that check whether: - whether open()/close() of RichFunctions are correctly called - Watermarks are correctly forwarded - Supersteps/checkpoint barriers are correctly forwarded and the blocking of inputs works correctly Add proper tests for Stream Operators These test whether: - open()/close() on RichFunctions are called - Timestamps of emitted elements match the timestamp of the input element - Watermarks are correctly forwarded [FLINK-2301] Fix Behaviour of BarrierBuffer and add Tests Before, a CheckpointBarrier from a more recent Checkpoint would also trigger unblocking while waiting on an older CheckpointBarrier. Now, a CheckpointBarrier from a newer checkpoint will unblock all channels and start a new wait on the new Checkpoint. The tests for OneInputStreamTask and TwoInputStreamTask check whether the buffer behaves correctly when receiving CheckpointBarriers from more recent checkpoints while still waiting on an older CheckpointBarrier.
- Loading branch information
Showing
150 changed files
with
6,913 additions
and
2,997 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 0 additions & 90 deletions
90
...k-streaming-core/src/main/java/org/apache/flink/streaming/api/collector/StreamOutput.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.