Jobs
Jobs

Reputation: 1307

Flink Savepoint and Window Operation

Below is a sample Flink code that I have used to test checkpoint/save point.

DataStream<Alarm> complexAlarmStream = alarmStream.keyBy(Alarm::getOntId)
.window(TumblingProcessingTimeWindows.of(Time.minutes(config                        .get(CheckPointTestingHighlevelFunctionParams.ONT_POWEROFF_DETECTION_WINDOW_TIME_IN_MIN))))
.process(new CheckPointTestingHighlevelFunction())
.uid("CheckPointTestingFunction").name("CheckPointTestingFunction");

Here the window is a stateful operation that holds the data for the amount of time mentioned in CheckPointTestingHighlevelFunctionParams.ONT_POWEROFF_DETECTION_WINDOW_TIME_IN_MIN

How to give a UID for the window function.

Upvotes: 0

Views: 69

Answers (1)

David Anderson
David Anderson

Reputation: 43439

The code you shared is setting a UID for the window operator. When you specify

.keyBy(...)
.window(...)
.allowedLateness(...)
.sideOutputLateData(...)
.process(...)
.uid("window-id").name("window-id")

all of that is contributing to the specification of the window operator.

Upvotes: 1

Related Questions