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

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

                Author: ASF GitHub Bot
            Created on: 17/Aug/18 22:54
            Start Date: 17/Aug/18 22:54
    Worklog Time Spent: 10m 
      Work Description: tweise closed pull request #6141: [BEAM-4679] Re-adding 
Flatten roots in ULR.
URL: https://github.com/apache/beam/pull/6141
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/EmptyInputProvider.java
 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/EmptyInputProvider.java
new file mode 100644
index 00000000000..82edcef7b1a
--- /dev/null
+++ 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/EmptyInputProvider.java
@@ -0,0 +1,38 @@
+/*
+ * 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.direct.portable;
+
+import java.util.Collection;
+import java.util.Collections;
+import 
org.apache.beam.runners.core.construction.graph.PipelineNode.PTransformNode;
+
+/** A {@link RootInputProvider} that provides no input bundles. */
+class EmptyInputProvider implements RootInputProvider<Void> {
+  EmptyInputProvider() {}
+
+  /**
+   * {@inheritDoc}.
+   *
+   * <p>Returns an empty collection.
+   */
+  @Override
+  public Collection<CommittedBundle<Void>> getInitialInputs(
+      PTransformNode transform, int targetParallelism) {
+    return Collections.emptyList();
+  }
+}
diff --git 
a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/ReferenceRunner.java
 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/ReferenceRunner.java
index 079c0d94fa4..ae4eb57fb8a 100644
--- 
a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/ReferenceRunner.java
+++ 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/ReferenceRunner.java
@@ -155,7 +155,7 @@ public void execute() throws Exception {
     BundleFactory bundleFactory = ImmutableListBundleFactory.create();
     EvaluationContext ctxt =
         EvaluationContext.create(Instant::new, bundleFactory, graph, 
getKeyedPCollections(graph));
-    RootProviderRegistry rootRegistry = 
RootProviderRegistry.impulseRegistry(bundleFactory);
+    RootProviderRegistry rootRegistry = 
RootProviderRegistry.javaPortableRegistry(bundleFactory);
     int targetParallelism = 
Math.max(Runtime.getRuntime().availableProcessors(), 3);
     ServerFactory serverFactory = createServerFactory();
     ControlClientPool controlClientPool = MapControlClientPool.create();
diff --git 
a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/RootProviderRegistry.java
 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/RootProviderRegistry.java
index e9702ba34fe..6b14a1a93d6 100644
--- 
a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/RootProviderRegistry.java
+++ 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/RootProviderRegistry.java
@@ -18,6 +18,7 @@
 package org.apache.beam.runners.direct.portable;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import static 
org.apache.beam.runners.core.construction.PTransformTranslation.FLATTEN_TRANSFORM_URN;
 import static 
org.apache.beam.runners.core.construction.PTransformTranslation.IMPULSE_TRANSFORM_URN;
 
 import com.google.common.collect.ImmutableMap;
@@ -25,7 +26,6 @@
 import java.util.Map;
 import org.apache.beam.runners.core.construction.PTransformTranslation;
 import 
org.apache.beam.runners.core.construction.graph.PipelineNode.PTransformNode;
-import org.apache.beam.sdk.transforms.Impulse;
 import org.apache.beam.sdk.transforms.PTransform;
 
 /**
@@ -33,13 +33,18 @@
  * based on the type of {@link PTransform} of the application.
  */
 class RootProviderRegistry {
-  /** Returns a {@link RootProviderRegistry} that only supports the {@link 
Impulse} primitive. */
-  public static RootProviderRegistry impulseRegistry(BundleFactory 
bundleFactory) {
+
+  /**
+   * Returns a {@link RootProviderRegistry} that supports the {@link Impulse} 
and {@link Flatten}
+   * primitives.
+   */
+  static RootProviderRegistry javaPortableRegistry(BundleFactory 
bundleFactory) {
     return new RootProviderRegistry(
         ImmutableMap.<String, RootInputProvider<?>>builder()
             .put(
                 IMPULSE_TRANSFORM_URN,
                 new ImpulseEvaluatorFactory.ImpulseRootProvider(bundleFactory))
+            .put(FLATTEN_TRANSFORM_URN, new EmptyInputProvider())
             .build());
   }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 135904)
    Time Spent: 3h 10m  (was: 3h)

> Support portable combiner lifting in Java Reference Runner
> ----------------------------------------------------------
>
>                 Key: BEAM-4679
>                 URL: https://issues.apache.org/jira/browse/BEAM-4679
>             Project: Beam
>          Issue Type: Sub-task
>          Components: runner-direct
>            Reporter: Daniel Oliveira
>            Assignee: Daniel Oliveira
>            Priority: Major
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Adjust the Reference Runner in Java to support portable combiner lifting as 
> described in the following doc:
> https://s.apache.org/beam-runner-api-combine-model



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

Reply via email to