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

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

                Author: ASF GitHub Bot
            Created on: 07/Mar/19 18:13
            Start Date: 07/Mar/19 18:13
    Worklog Time Spent: 10m 
      Work Description: ibzib commented on pull request #8011: [BEAM-6327] move 
pipeline trimming logic from Flink runner to core co…
URL: https://github.com/apache/beam/pull/8011#discussion_r263504829
 
 

 ##########
 File path: 
runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/graph/PipelineTrimmer.java
 ##########
 @@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.core.construction.graph;
+
+import java.util.Set;
+import org.apache.beam.model.pipeline.v1.RunnerApi;
+import org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline;
+import org.apache.beam.runners.core.construction.PTransformTranslation;
+import 
org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableSet;
+import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Sets;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO(BEAM-6327): Remove the need for this.
+
+/** PipelineTrimmer removes subcomponents of native transforms that shouldn't 
be fused. */
+public class PipelineTrimmer {
+  private static final Logger LOG = 
LoggerFactory.getLogger(PipelineTrimmer.class);
+
+  /**
+   * Remove subcomponents of native transforms that shouldn't be fused.
+   *
+   * @param pipeline the pipeline to be trimmed
+   * @param knownUrns set of URNs for the runner's native transforms
+   * @return the trimmed pipeline
+   */
+  public static Pipeline trim(Pipeline pipeline, Set<String> knownUrns) {
+    RunnerApi.Pipeline trimmedPipeline =
+        makeKnownUrnsPrimitives(
+            pipeline,
+            Sets.difference(
+                knownUrns, 
ImmutableSet.of(PTransformTranslation.ASSIGN_WINDOWS_TRANSFORM_URN)));
 
 Review comment:
   If someone could explain why transform windows is excluded, I'd like to add 
a comment here.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 209690)
    Time Spent: 0.5h  (was: 20m)

> Don't attempt to fuse subtransforms of primitive/known transforms.
> ------------------------------------------------------------------
>
>                 Key: BEAM-6327
>                 URL: https://issues.apache.org/jira/browse/BEAM-6327
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-direct
>            Reporter: Robert Bradshaw
>            Assignee: Kyle Weaver
>            Priority: Major
>              Labels: triaged
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently we must remove all sub-components of any known transform that may 
> have an optional substructure, e.g. 
> [https://github.com/apache/beam/blob/release-2.9.0/sdks/python/apache_beam/runners/portability/portable_runner.py#L126]
>  (for GBK) and [https://github.com/apache/beam/pull/7360] (Reshuffle).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to