You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by GitBox <gi...@apache.org> on 2020/03/04 22:51:36 UTC

[GitHub] [beam] chamikaramj commented on a change in pull request #10621: [BEAM-9056] Staging artifacts from environment

chamikaramj commented on a change in pull request #10621: [BEAM-9056] Staging artifacts from environment
URL: https://github.com/apache/beam/pull/10621#discussion_r387982425
 
 

 ##########
 File path: runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/SdkComponents.java
 ##########
 @@ -261,14 +263,20 @@ public String registerCoder(Coder<?> coder) throws IOException {
    * return the same unique ID.
    */
   public String registerEnvironment(Environment env) {
+    String environmentId;
     String existing = environmentIds.get(env);
     if (existing != null) {
-      return existing;
+      environmentId = existing;
+    } else {
+      String name = uniqify(env.getUrn(), environmentIds.values());
+      environmentIds.put(env, name);
+      componentsBuilder.putEnvironments(name, env);
+      environmentId = name;
     }
-    String name = uniqify(env.getUrn(), environmentIds.values());
-    environmentIds.put(env, name);
-    componentsBuilder.putEnvironments(name, env);
-    return name;
+    if (defaultEnvironmentId == null) {
 
 Review comment:
   Why should this be a separate ticket ? Can't we just change method to registerEnvironment(Environment env, boolean default)
   and change above to
   
   sdkComponents.registerEnvironment(	        
       Environments.createOrGetDefaultEnvironment(portablePipelineOptions), true);

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services