Skip to content

Revise Beam programming guide for new DoFn#36

Closed
kennknowles wants to merge 2 commits intoapache:asf-sitefrom
kennknowles:new-DoFn
Closed

Revise Beam programming guide for new DoFn#36
kennknowles wants to merge 2 commits intoapache:asf-sitefrom
kennknowles:new-DoFn

Conversation

@kennknowles
Copy link
Member

@kennknowles
Copy link
Member Author

Actual changes are in the first commit, rebuild in the second.

```

Inside your `DoFn` subclass, you'll need to override the method `processElement`, where you provide the actual processing logic. You don't need to manually extract the elements from the input collection; the Beam SDKs handle that for you. Your override of `processElement` should accept an object of type `ProcessContext`. The `ProcessContext` object gives you access to an input element and a method for emitting an output element:
Inside your `DoFn` subclass, you'll write a method annotated with `@ProcessElement` where you provide the actual processing logic. You don't need to manually extract the elements from the input collection; the Beam SDKs handle that for you. Your `@ProcessElement` method should accept an object of type `ProcessContext`. The `ProcessContext` object gives you access to an input element and a method for emitting an output element:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what Devin's plans were for making this language-independent. If this is general prose, we should avoid java-specific implementation details. But that's probably a topic for another day ;-)

@francesperry
Copy link
Member

LGTM. Will merge.

@asfgit asfgit closed this in e2430eb Aug 9, 2016
robertwb pushed a commit to robertwb/incubator-beam that referenced this pull request Jun 5, 2018
melap pushed a commit to apache/beam that referenced this pull request Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants