[ 
https://issues.apache.org/jira/browse/BEAM-11914?focusedWorklogId=567413&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-567413
 ]

ASF GitHub Bot logged work on BEAM-11914:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Mar/21 03:32
            Start Date: 17/Mar/21 03:32
    Worklog Time Spent: 10m 
      Work Description: kennknowles commented on a change in pull request 
#14155:
URL: https://github.com/apache/beam/pull/14155#discussion_r595688093



##########
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:
       You shouldn't need this. This is the "old" DoFn way of doing it.

##########
File path: 
runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/SplittableParDoNaiveBounded.java
##########
@@ -134,9 +134,30 @@ public PCollectionTuple expand(PCollection<KV<byte[], 
KV<InputT, RestrictionT>>>
     }
 
     @Setup
-    public void setup() {
+    public void setup(SetupContext c) {

Review comment:
       Other `DoFn` methods support a `PipelineOptions` type argument and the 
`DoFnSignature` detects this.




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 567413)
    Time Spent: 40m  (was: 0.5h)

> Add PipelineOptions as DoFn @Setup parameters
> ---------------------------------------------
>
>                 Key: BEAM-11914
>                 URL: https://issues.apache.org/jira/browse/BEAM-11914
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Xinyu Liu
>            Assignee: Xinyu Liu
>            Priority: P2
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Passing PipelineOptions to DoFn @Setup makes it easier for the users to 
> access their pipeline arguments. It also allows dynamically creating 
> PipelineOptions while constructing the pipeline, and can benefit integration 
> with other config management framework.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to