xinyuiscool commented on a change in pull request #14155:
URL: https://github.com/apache/beam/pull/14155#discussion_r596233734



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFn.java
##########
@@ -91,6 +91,16 @@
  */
 public abstract class DoFn<InputT extends @Nullable Object, OutputT extends 
@Nullable Object>
     implements Serializable, HasDisplayData {
+  /** Information accessible while within the {@link Setup} method. */
+  @SuppressWarnings("ClassCanBeStatic") // Converting class to static is an 
API change.
+  public abstract class SetupContext {

Review comment:
       Right, currently my impl is to pass this SetupContext to 
ArgumentProvider to get the arguments. I can remove this context and pass in 
the PipelineOptions directly.
   
   Regarding to removing all contexts: I feel at least ProcessContext is kind 
of useful from the user point of view. Since @ProcessElement can take in quite 
a few parameters, it's a bit hard for the users to remember each kind of them 
(sometimes even I have to look it up to see what's the name of the types). 
ProcessContext does provide a good entry point to access element, output 
receiver, and side input. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to