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

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

                Author: ASF GitHub Bot
            Created on: 04/Apr/19 09:51
            Start Date: 04/Apr/19 09:51
    Worklog Time Spent: 10m 
      Work Description: mxm commented on pull request #7954: [BEAM-6747] Adding 
ExternalTransform in JavaSDK
URL: https://github.com/apache/beam/pull/7954#discussion_r272089187
 
 

 ##########
 File path: 
runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/ExternalTest.java
 ##########
 @@ -0,0 +1,187 @@
+/*
+ * 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;
+
+import com.google.auto.service.AutoService;
+import java.io.IOException;
+import java.io.Serializable;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+import org.apache.beam.runners.core.construction.expansion.ExpansionService;
+import org.apache.beam.sdk.testing.PAssert;
+import org.apache.beam.sdk.testing.TestPipeline;
+import org.apache.beam.sdk.testing.UsesCrossLanguageTransforms;
+import org.apache.beam.sdk.testing.ValidatesRunner;
+import org.apache.beam.sdk.transforms.Create;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.Filter;
+import org.apache.beam.sdk.transforms.MapElements;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollectionTuple;
+import org.apache.beam.sdk.values.TupleTag;
+import org.apache.beam.sdk.values.TupleTagList;
+import org.apache.beam.sdk.values.TypeDescriptor;
+import org.apache.beam.sdk.values.TypeDescriptors;
+import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.ConnectivityState;
+import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.ManagedChannel;
+import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.ManagedChannelBuilder;
+import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.Server;
+import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.ServerBuilder;
+import 
org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/** Test External transforms. */
+@RunWith(JUnit4.class)
+public class ExternalTest implements Serializable {
+  @Rule public transient TestPipeline testPipeline = TestPipeline.create();
+
+  private static Server expansionServer;
+  private static final int EXPANSION_PORT = 8096;
+  private static final String EXPANSION_ADDR = String.format("localhost:%s", 
EXPANSION_PORT);
+  private static String pythonServerCommand;
+
+  @BeforeClass
+  public static void setUp() throws IOException {
+    pythonServerCommand = System.getProperty("pythonTestExpansionCommand");
+
+    expansionServer =
+        ServerBuilder.forPort(EXPANSION_PORT).addService(new 
ExpansionService()).build();
+    expansionServer.start();
+  }
+
+  @AfterClass
+  public static void tearDown() {
+    expansionServer.shutdownNow();
+  }
+
+  @Test
+  @Category({ValidatesRunner.class, UsesCrossLanguageTransforms.class})
+  public void expandSingleTest() {
+    PCollection<Integer> col =
+        testPipeline
+            .apply(Create.of(1, 2, 3))
+            .apply(External.of("simple", new byte[] {}, EXPANSION_ADDR));
 
 Review comment:
   Could we assign static variables to this and other external transform names?
 
----------------------------------------------------------------
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: 222888)
    Time Spent: 3h  (was: 2h 50m)

> Adding ExternalTransform in JavaSDK
> -----------------------------------
>
>                 Key: BEAM-6747
>                 URL: https://issues.apache.org/jira/browse/BEAM-6747
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-core
>            Reporter: Heejong Lee
>            Assignee: Heejong Lee
>            Priority: Major
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> Adding Java counterpart of Python ExternalTransform for testing Python 
> transforms from pipelines in Java SDK.



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

Reply via email to