Summary
Expose a helper on Message to construct a dropped message from a Datum, so users can explicitly emit drops from an accumulator (and other UDFs) to allow the watermark to progress and tracked windows/messages to be cleaned up.
Proposed API:
// Builds a Message from the given Datum with drop tags set, so the message is not
// forwarded to the next vertex but still allows the accumulator to advance the
// watermark and release tracked state.
public static Message toDrop(Datum datum);
This complements the existing new Message(datum) constructor used in StreamSorterFactory.java.
Motivation
Today there is no clean way for an accumulator to signal "I have handled this datum but don't want to forward it." Users that omit output for some inputs (e.g. blackhole / filter / multiplexer-style accumulators) end up retaining tracked windows and messages, which leads to unbounded memory growth.
Related: numaproj/numaflow-python#356
Example usage
@Override
public void processMessage(Datum datum, OutputStreamObserver outputStream) {
if (shouldDrop(datum)) {
outputStream.send(Message.toDrop(datum));
return;
}
outputStream.send(new Message(datum));
}
Acceptance criteria
Summary
Expose a helper on
Messageto construct a dropped message from aDatum, so users can explicitly emit drops from an accumulator (and other UDFs) to allow the watermark to progress and tracked windows/messages to be cleaned up.Proposed API:
This complements the existing
new Message(datum)constructor used inStreamSorterFactory.java.Motivation
Today there is no clean way for an accumulator to signal "I have handled this datum but don't want to forward it." Users that omit output for some inputs (e.g. blackhole / filter / multiplexer-style accumulators) end up retaining tracked windows and messages, which leads to unbounded memory growth.
Related: numaproj/numaflow-python#356
Example usage
Acceptance criteria
Message.toDrop(datum)constructs aMessagefrom aDatumwith drop tags set.