Apache Flink为WindowOperator设置OutputTag类型的lateDataOutputTag.&



我最近在做flink,我的应用程序只是基于TumblingEventTimeWindows来统计记录数,但是有一些记录是晚来的,所以我只是想统计一下晚来的记录数

我读了WindowOperator源代码:

// side output input event if
// element not handled by any window
// late arriving tag has been set
// windowAssigner is event time and current timestamp + allowed lateness no less than
// element timestamp
if (isSkippedElement && isElementLate(element)) {
if (lateDataOutputTag != null) {
sideOutput(element);
} else {
this.numLateRecordsDropped.inc();
}
}

那么如何设置值为lateDataOutputTag而初始化?

阅读flink的源代码后。我发现它是由windowwedstream . sideoutputlatedata ();

设置的
datastream.keyby(...).window(...).sideOutputLateData(...)

WindowOperator由WindowOperatorBuilder初始化。

最新更新