kennknowles commented on code in PR #41593:
URL: https://github.com/apache/beam/pull/41593#discussion_r4760188729
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFn.java:
##########
@@ -427,10 +427,47 @@ public TypeDescriptor<OutputT> getOutputTypeDescriptor() {
return new TypeDescriptor<OutputT>(getClass()) {};
}
+ /**
+ * Receives values of the given type with explicit timestamp, window(s), and
{@link PaneInfo}.
+ *
+ * <p>Used in contexts without an implicit input element (such as {@link
+ * FinishBundle @FinishBundle}).
+ */
+ public interface WindowedOutputReceiver<T> {
Review Comment:
The big risk here is that people/agents neglect important metadata. I have
two contradictory opinions :-)
1. I think the convenience functions to provide fewer parameters may
actually be an anti-pattern. The set of metadata is designed/expected to grow
and each one must be handled somehow. Forcing a person/agent to populate or
explicitly pass `Optional.empty()` for every parameter forces thinking about
it, which is especially important for agents who will maybe synthesize
something good with zero effort.
2. Perhaps the very simplest thing is to take a now-public `WindowedValue`
so that the API for the receiver can be stable. Actually I see that you
implemented the `builder()` method. I would honestly just do that, and not add
the other methods. This way any metadata that _can_ be done automatically will
be propagated instead of being dropped.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]