jonathansudhakar1 commented on issue #22887: URL: https://github.com/apache/beam/issues/22887#issuecomment-7381000481
@kennknowles, your answer above never made it into the docs. The Java text in programming guide §4.2.1.2 "Creating a DoFn" still ends with "Note: `@Element` and `OutputReceiver` were introduced in Beam 2.5.0; if using an earlier release of Beam, a `ProcessContext` parameter should be used instead." ([programming-guide.md#L1097-L1100](https://github.com/apache/beam/blob/6873c8c88f7/website/www/site/content/en/documentation/programming-guide.md#L1097-L1100)). That's the only guidance on choosing between the two. Proposed change, docs only: 1. In §4.2.1.2, replace that note with roughly: "`@Element` and `OutputReceiver` replace the older `ProcessContext` parameter (`c.element()`, `c.output(...)`), which still works. Prefer them: a `DoFn` that takes only the parameters it uses tells the runner which capabilities it needs, while a `DoFn` that takes a `ProcessContext` may use any of them." 2. In §4.5.2 "Emitting to multiple outputs in your DoFn", add one sentence to the Java text saying that `MultiOutputReceiver` is the preferred way to emit to tagged outputs, rather than `ProcessContext.output(TupleTag, T)`, for the same reason. No snippet or code changes. Does that wording match what you'd want users to take away, and would it be enough to close this issue? If so, I'm happy to send the PR. -- 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]
