I have a windowed KTable working as expected, but it is outputting every time a new value is received. I found the .suppress operator and it does exactly what I want: output results only at the end of the time window. I have added a grace value to my TimeWindow, but cannot get .suppress to work with the windowed KTable. The answer to this question shows what .suppress should look like.
It appears to me when reading Apache's documentation, that untilWindowCloses is a method of the Suppressed interface, meaning I can't instantiate a Suppressed object, correct? I'm not sure how to implement an interface in this way (in the arguments for .suppress on a windowed KTable).
I feel like I'm missing something stupid, but I've searched and searched and can't figure it out. Any ideas?
TimeWindows window = TimeWindows.of(Duration.ofMinutes(1)).grace(Duration.ofSeconds(10));
final KTable<Windowed<String>, GenericRecord> joinedKTable = groupedStream
.windowedBy(window)
.reduce(new Reducer<GenericRecord>() {
@Override
public GenericRecord apply(GenericRecord aggValue, GenericRecord newValue) {
//reduce code
}
})
.suppress(Suppressed.untilWindowCloses(unbounded())); //need help here
I am using Eclipse and it's telling me "The method unbounded() is undefined." What am I doing wrong?