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

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

                Author: ASF GitHub Bot
            Created on: 19/Mar/20 20:49
            Start Date: 19/Mar/20 20:49
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on pull request #11165: [BEAM-9340] 
Populate requirements for Java.
URL: https://github.com/apache/beam/pull/11165#discussion_r395310246
 
 

 ##########
 File path: 
runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/SdkComponents.java
 ##########
 @@ -86,25 +91,30 @@ public static SdkComponents create(RunnerApi.Components 
components) {
   }
 
   public static SdkComponents create(PipelineOptions options) {
-    SdkComponents sdkComponents = new 
SdkComponents(RunnerApi.Components.getDefaultInstance(), "");
+    SdkComponents sdkComponents =
+        new SdkComponents(RunnerApi.Components.getDefaultInstance(), null, "");
     PortablePipelineOptions portablePipelineOptions = 
options.as(PortablePipelineOptions.class);
     sdkComponents.registerEnvironment(
         Environments.createOrGetDefaultEnvironment(portablePipelineOptions));
     return sdkComponents;
   }
 
-  private SdkComponents(RunnerApi.Components components, String newIdPrefix) {
+  private SdkComponents(
+      Components components, Collection<String> requirements, String 
newIdPrefix) {
     this.newIdPrefix = newIdPrefix;
+    this.requirements = new HashSet<>();
 
     if (components == null) {
-      return;
+      if (requirements != null) {
+        this.requirements.addAll(requirements);
+      }
+    } else {
+      mergeFrom(components, requirements);
     }
-
-    mergeFrom(components);
   }
 
   /** Merge Components proto into this SdkComponents instance. */
-  public void mergeFrom(RunnerApi.Components components) {
+  public void mergeFrom(RunnerApi.Components components, Collection<String> 
requirements) {
 
 Review comment:
   ```suggestion
     public void mergeFrom(RunnerApi.Components components, @Nullable 
Collection<String> requirements) {
   ```
 
----------------------------------------------------------------
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: 406568)
    Time Spent: 1h 20m  (was: 1h 10m)

> Properly populate pipeline proto requirements.
> ----------------------------------------------
>
>                 Key: BEAM-9340
>                 URL: https://issues.apache.org/jira/browse/BEAM-9340
>             Project: Beam
>          Issue Type: New Feature
>          Components: beam-model, sdk-go, sdk-java-core, sdk-py-core
>            Reporter: Robert Bradshaw
>            Assignee: Robert Bradshaw
>            Priority: Major
>             Fix For: 2.20.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>




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

Reply via email to