flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AndreaKinn <kinn6...@hotmail.it>
Subject Re: Handle event time
Date Fri, 08 Sep 2017 10:50:02 GMT
Thank you, effectively I developed also a simple custom solution for
watermark looking at flink doc but anyway I see unordered printed streams.
I have a doubt about flink behaviour: if I understand, flink doesn't perform
automatically reordering of records in a stream, so if for instance a record
arrives in late what is the behaviour of flink? In the doc it's described
that elements arrive after in late are dropped (allowed lateness default
value is 0) but also using this watermark emitter:

*public class CustomTimestampExtractor implements
AssignerWithPeriodicWatermarks<Tuple6&lt;String, String, Date, String,
String, Double>>{

	private static final long serialVersionUID = 5448621759931440489L;
	private final long maxOutOfOrderness = 0;
    private long currentMaxTimestamp;
	public long extractTimestamp(Tuple6<String, String, Date, String, String,
Double> element, long previousElementTimestamp) {
		long timestamp = element.f2.getTime();
		currentMaxTimestamp = Math.max(timestamp, currentMaxTimestamp);
		return timestamp;

	public Watermark getCurrentWatermark() {
		return new Watermark(currentMaxTimestamp - maxOutOfOrderness);

with maxOutOfOrderness = 0 I see unordered record in the stream.

What I want to obtain is a fully ordered stream, is there a way to implement

Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/

View raw message