beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [3/5] beam git commit: Add translation convenience for non-composites
Date Mon, 05 Jun 2017 04:48:30 GMT
Add translation convenience for non-composites


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/9c3fbc37
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/9c3fbc37
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/9c3fbc37

Branch: refs/heads/master
Commit: 9c3fbc37e9b703c381d284808dfcfef67bb8b531
Parents: f1386c1
Author: Kenneth Knowles <klk@google.com>
Authored: Thu Jun 1 13:01:20 2017 -0700
Committer: Kenneth Knowles <klk@google.com>
Committed: Fri Jun 2 10:06:52 2017 -0700

----------------------------------------------------------------------
 .../core/construction/PTransformTranslation.java        | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/9c3fbc37/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/PTransformTranslation.java
----------------------------------------------------------------------
diff --git a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/PTransformTranslation.java
b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/PTransformTranslation.java
index 99d1e85..b2f06ac 100644
--- a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/PTransformTranslation.java
+++ b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/PTransformTranslation.java
@@ -24,6 +24,7 @@ import com.google.common.collect.ImmutableMap;
 import com.google.protobuf.Any;
 import com.google.protobuf.Message;
 import java.io.IOException;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.ServiceLoader;
@@ -120,6 +121,17 @@ public class PTransformTranslation {
     return transformBuilder.build();
   }
 
+  /**
+   * Translates a non-composite {@link AppliedPTransform} into a runner API proto.
+   *
+   * <p>Does not register the {@code appliedPTransform} within the provided {@link
SdkComponents}.
+   */
+  static RunnerApi.PTransform toProto(
+      AppliedPTransform<?, ?, ?> appliedPTransform, SdkComponents components) throws
IOException {
+    return toProto(
+        appliedPTransform, Collections.<AppliedPTransform<?, ?, ?>>emptyList(),
components);
+  }
+
   private static String toProto(TupleTag<?> tag) {
     return tag.getId();
   }


Mime
View raw message