tejasiyer-dev commented on code in PR #41593:
URL: https://github.com/apache/beam/pull/41593#discussion_r4759576435
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFn.java:
##########
@@ -993,8 +993,12 @@ public interface MultiOutputReceiver {
* commits the output of this bundle. See <a
* href="https://s.apache.org/beam-finalizing-bundles">Apache Beam
Portability API: How to
* Finalize Bundles</a> for further details.
- * <li>TODO(https://github.com/apache/beam/issues/18203): Add support for
an {@link
- * OutputReceiver} and {@link MultiOutputReceiver} that can output to
a window.
+ * <li>If one of the parameters is of type {@link OutputReceiver}
(parameterized with {@code
+ * OutputT} or {@link Row} when the output has a schema) or {@link
MultiOutputReceiver},
+ * then it can be used to emit elements from {@link FinishBundle
@FinishBundle}. Because
+ * {@link FinishBundle @FinishBundle} is not associated with a single
input element, callers
+ * must explicitly provide the timestamp, window(s), and {@link
PaneInfo} (for example, via
+ * {@link OutputReceiver#outputWindowedValue} or {@link
OutputReceiver#builder}).
Review Comment:
Done.
Added `WindowedOutputReceiver` and `WindowedMultiOutputReceiver` as more
restrictive interfaces that omit `output`, `outputWithTimestamp`, and 1-arg
`builder(value)`, exposing only the full-context `outputWindowedValue` and
4-arg `builder` methods.
`@FinishBundle` now rejects `OutputReceiver`/`MultiOutputReceiver` during
signature validation and only allows `WindowedOutputReceiver` and
`WindowedMultiOutputReceiver`, so omitting timestamp, windows, or paneInfo is a
compile error instead of a runtime exception.
--
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]