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

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

                Author: ASF GitHub Bot
            Created on: 21/May/18 17:21
            Start Date: 21/May/18 17:21
    Worklog Time Spent: 10m 
      Work Description: tgroh closed pull request #5369: [BEAM-2885] Move the 
Local Artifact Services to the DirectRunner
URL: https://github.com/apache/beam/pull/5369
 
 
   

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/build.gradle b/runners/direct-java/build.gradle
index f0e6b74de69..220f4fcffb9 100644
--- a/runners/direct-java/build.gradle
+++ b/runners/direct-java/build.gradle
@@ -56,6 +56,7 @@ dependencies {
   compile project(path: ":beam-runners-core-construction-java", configuration: 
"shadow")
   compile project(path: ":beam-runners-core-java", configuration: "shadow")
   compile project(path: ":beam-runners-local-java-core", configuration: 
"shadow")
+  compile project(path: ":beam-runners-java-fn-execution", configuration: 
"shadow")
   shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
   shadow library.java.joda_time
   shadow library.java.findbugs_jsr305
diff --git 
a/runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/LocalArtifactStagingLocation.java
 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/LocalArtifactStagingLocation.java
similarity index 97%
rename from 
runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/LocalArtifactStagingLocation.java
rename to 
runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/LocalArtifactStagingLocation.java
index e11125f75a3..146a091fbbe 100644
--- 
a/runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/LocalArtifactStagingLocation.java
+++ 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/LocalArtifactStagingLocation.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.beam.artifact.local;
+package org.apache.beam.runners.direct.portable.artifact;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
@@ -29,7 +29,7 @@
  * A location where the results of an {@link 
LocalFileSystemArtifactStagerService} are stored and
  * where the retrieval service retrieves them from.
  */
-public class LocalArtifactStagingLocation {
+class LocalArtifactStagingLocation {
   /**
    * Create a new {@link LocalArtifactStagingLocation} rooted at the specified 
location, creating
    * any directories or subdirectories as necessary.
diff --git 
a/runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/LocalFileSystemArtifactRetrievalService.java
 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactRetrievalService.java
similarity index 98%
rename from 
runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/LocalFileSystemArtifactRetrievalService.java
rename to 
runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactRetrievalService.java
index 73afcdcba96..7372ce7fb39 100644
--- 
a/runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/LocalFileSystemArtifactRetrievalService.java
+++ 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactRetrievalService.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.beam.artifact.local;
+package org.apache.beam.runners.direct.portable.artifact;
 
 import com.google.protobuf.ByteString;
 import io.grpc.Status;
diff --git 
a/runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/LocalFileSystemArtifactStagerService.java
 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactStagerService.java
similarity index 95%
rename from 
runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/LocalFileSystemArtifactStagerService.java
rename to 
runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactStagerService.java
index 049d6147633..3f84e75c4da 100644
--- 
a/runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/LocalFileSystemArtifactStagerService.java
+++ 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactStagerService.java
@@ -15,8 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-package org.apache.beam.artifact.local;
+package org.apache.beam.runners.direct.portable.artifact;
 
 import static com.google.common.base.Preconditions.checkState;
 
@@ -45,7 +44,7 @@
   private static final Logger LOG =
       LoggerFactory.getLogger(LocalFileSystemArtifactStagerService.class);
 
-  public static LocalFileSystemArtifactStagerService withRootDirectory(File 
base) {
+  public static LocalFileSystemArtifactStagerService forRootDirectory(File 
base) {
     return new LocalFileSystemArtifactStagerService(base);
   }
 
@@ -207,9 +206,13 @@ private FileWritingObserver(
     public void onNext(ArtifactApi.PutArtifactRequest value) {
       try {
         if (value.getData() == null) {
-          StatusRuntimeException e = 
Status.INVALID_ARGUMENT.withDescription(String.format(
-              "Expected all chunks in the current stream state to contain 
data, got %s",
-              value.getContentCase())).asRuntimeException();
+          StatusRuntimeException e =
+              Status.INVALID_ARGUMENT
+                  .withDescription(
+                      String.format(
+                          "Expected all chunks in the current stream state to 
contain data, got %s",
+                          value.getContentCase()))
+                  .asRuntimeException();
           throw e;
         }
         value.getData().getData().writeTo(target);
diff --git 
a/runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/package-info.java
 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/package-info.java
similarity index 86%
rename from 
runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/package-info.java
rename to 
runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/package-info.java
index 17d0943b533..1ec0da5b888 100644
--- 
a/runners/local-artifact-service-java/src/main/java/org/apache/beam/artifact/local/package-info.java
+++ 
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/artifact/package-info.java
@@ -16,7 +16,5 @@
  * limitations under the License.
  */
 
-/**
- * Provides local implementations of the Artifact API services.
- */
-package org.apache.beam.artifact.local;
+/** Provides local implementations of the Artifact API services. */
+package org.apache.beam.runners.direct.portable.artifact;
diff --git 
a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerApiSurfaceTest.java
 
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerApiSurfaceTest.java
index 2493727538d..d41eaac41c7 100644
--- 
a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerApiSurfaceTest.java
+++ 
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/DirectRunnerApiSurfaceTest.java
@@ -46,7 +46,6 @@ public void testDirectRunnerApiSurface() throws Exception {
         ImmutableSet.of(
             "org.apache.beam.sdk",
             "org.apache.beam.runners.direct",
-            "org.apache.beam.runners.direct.portable",
             "org.joda.time",
             "javax.annotation");
 
@@ -67,6 +66,9 @@ public void testDirectRunnerApiSurface() throws Exception {
             .pruningClass(
                 WatermarkManager.class /* TODO: BEAM-4237 Consider moving to 
local-java */)
             .pruningClass(ExecutableGraphBuilder.class)
+            .pruningPattern(
+                "org[.]apache[.]beam[.]runners[.]direct[.]portable.*"
+                /* TODO: BEAM-4237 reconsider package layout with the 
ReferenceRunner */)
             .pruningPattern("org[.]apache[.]beam[.].*Test.*")
             .pruningPattern("org[.]apache[.]beam[.].*IT")
             .pruningPattern("java[.]io.*")
diff --git 
a/runners/local-artifact-service-java/src/test/java/org/apache/beam/artifact/local/LocalArtifactStagingLocationTest.java
 
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/portable/artifact/LocalArtifactStagingLocationTest.java
similarity index 98%
rename from 
runners/local-artifact-service-java/src/test/java/org/apache/beam/artifact/local/LocalArtifactStagingLocationTest.java
rename to 
runners/direct-java/src/test/java/org/apache/beam/runners/direct/portable/artifact/LocalArtifactStagingLocationTest.java
index 6da70455919..99e2cce1b09 100644
--- 
a/runners/local-artifact-service-java/src/test/java/org/apache/beam/artifact/local/LocalArtifactStagingLocationTest.java
+++ 
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/portable/artifact/LocalArtifactStagingLocationTest.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.beam.artifact.local;
+package org.apache.beam.runners.direct.portable.artifact;
 
 import static com.google.common.base.Preconditions.checkState;
 import static org.hamcrest.Matchers.equalTo;
diff --git 
a/runners/local-artifact-service-java/src/test/java/org/apache/beam/artifact/local/LocalFileSystemArtifactRetrievalServiceTest.java
 
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactRetrievalServiceTest.java
similarity index 98%
rename from 
runners/local-artifact-service-java/src/test/java/org/apache/beam/artifact/local/LocalFileSystemArtifactRetrievalServiceTest.java
rename to 
runners/direct-java/src/test/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactRetrievalServiceTest.java
index 1f7a5237e9f..e49588b2776 100644
--- 
a/runners/local-artifact-service-java/src/test/java/org/apache/beam/artifact/local/LocalFileSystemArtifactRetrievalServiceTest.java
+++ 
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactRetrievalServiceTest.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.beam.artifact.local;
+package org.apache.beam.runners.direct.portable.artifact;
 
 import static org.hamcrest.Matchers.containsInAnyOrder;
 import static org.hamcrest.Matchers.containsString;
@@ -79,7 +79,7 @@ public void setup() throws Exception {
     root = tmp.newFolder();
     stagerServer =
         GrpcFnServer.allocatePortAndCreateFor(
-            LocalFileSystemArtifactStagerService.withRootDirectory(root), 
serverFactory);
+            LocalFileSystemArtifactStagerService.forRootDirectory(root), 
serverFactory);
   }
 
   @After
diff --git 
a/runners/local-artifact-service-java/src/test/java/org/apache/beam/artifact/local/LocalFileSystemArtifactStagerServiceTest.java
 
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactStagerServiceTest.java
similarity index 98%
rename from 
runners/local-artifact-service-java/src/test/java/org/apache/beam/artifact/local/LocalFileSystemArtifactStagerServiceTest.java
rename to 
runners/direct-java/src/test/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactStagerServiceTest.java
index 0d850960360..2bc8f1285de 100644
--- 
a/runners/local-artifact-service-java/src/test/java/org/apache/beam/artifact/local/LocalFileSystemArtifactStagerServiceTest.java
+++ 
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/portable/artifact/LocalFileSystemArtifactStagerServiceTest.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.beam.artifact.local;
+package org.apache.beam.runners.direct.portable.artifact;
 
 import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;
@@ -58,7 +58,7 @@
 
   @Before
   public void setup() throws Exception {
-    stager = 
LocalFileSystemArtifactStagerService.withRootDirectory(temporaryFolder.newFolder());
+    stager = 
LocalFileSystemArtifactStagerService.forRootDirectory(temporaryFolder.newFolder());
 
     server =
         InProcessServerBuilder.forName("fs_stager")
diff --git a/runners/local-artifact-service-java/build.gradle 
b/runners/local-artifact-service-java/build.gradle
deleted file mode 100644
index d4761bd5e85..00000000000
--- a/runners/local-artifact-service-java/build.gradle
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-
-apply from: project(":").file("build_rules.gradle")
-applyJavaNature()
-
-description = "Apache Beam :: Runners :: Java Local Artifact Service"
-ext.summary = """The Beam Artifact Service exposes APIs to stage and retrieve
-artifacts in a manner independent of the underlying storage system, for use
-by the Beam portability framework. The local implementation uses the local
-File System as the underlying storage system."""
-
-dependencies {
-  compile library.java.guava
-  shadow project(path: ":beam-model-job-management", configuration: "shadow")
-  shadow project(path: ":beam-model-pipeline", configuration: "shadow")
-  shadow project(path: ":beam-runners-java-fn-execution", configuration: 
"shadow")
-  shadow library.java.findbugs_jsr305
-  shadow library.java.grpc_core
-  shadow library.java.grpc_stub
-  shadow library.java.protobuf_java
-  shadow library.java.slf4j_api
-  testCompile project(path: ":beam-runners-core-construction-java")
-  testCompile library.java.hamcrest_core
-  testCompile library.java.hamcrest_library
-  testCompile library.java.mockito_core
-  testCompile library.java.junit
-  testCompile library.java.slf4j_jdk14
-}
diff --git a/runners/local-artifact-service-java/pom.xml 
b/runners/local-artifact-service-java/pom.xml
deleted file mode 100644
index d68971eaae9..00000000000
--- a/runners/local-artifact-service-java/pom.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.beam</groupId>
-    <artifactId>beam-runners-parent</artifactId>
-    <version>2.5.0-SNAPSHOT</version>
-    <relativePath>../pom.xml</relativePath>
-  </parent>
-
-  <artifactId>beam-local-artifact-service-java</artifactId>
-  <name>Apache Beam :: Runners :: Java Local Artifact Service</name>
-  <description>The Beam Artifact Service exposes APIs to stage and retrieve
-    artifacts in a manner independent of the underlying storage system, for use
-    by the Beam portability framework. The local implementation uses the local
-    File System as the underlying storage system.</description>
-
-  <packaging>jar</packaging>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-      </plugin>
-
-      <!-- Coverage analysis for unit tests. -->
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.beam</groupId>
-      <artifactId>beam-model-job-management</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.beam</groupId>
-      <artifactId>beam-model-pipeline</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.beam</groupId>
-      <artifactId>beam-runners-java-fn-execution</artifactId>
-    </dependency>
-
-    <!-- build dependencies -->
-    <dependency>
-      <groupId>com.google.code.findbugs</groupId>
-      <artifactId>jsr305</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>io.grpc</groupId>
-      <artifactId>grpc-core</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>io.grpc</groupId>
-      <artifactId>grpc-stub</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.google.protobuf</groupId>
-      <artifactId>protobuf-java</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-
-    <!-- test dependencies -->
-    <dependency>
-      <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest-library</artifactId>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-jdk14</artifactId>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.beam</groupId>
-      <artifactId>beam-runners-core-construction-java</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/settings.gradle b/settings.gradle
index f0703a32adb..48ff0c231e4 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -50,8 +50,6 @@ include "beam-runners-google-cloud-dataflow-java"
 project(":beam-runners-google-cloud-dataflow-java").dir = 
file("runners/google-cloud-dataflow-java")
 include "beam-runners-java-fn-execution"
 project(":beam-runners-java-fn-execution").dir = 
file("runners/java-fn-execution")
-include "beam-local-artifact-service-java"
-project(":beam-local-artifact-service-java").dir = 
file("runners/local-artifact-service-java")
 include "beam-runners-local-java-core"
 project(":beam-runners-local-java-core").dir = file("runners/local-java")
 include "beam-runners-reference-java"


 

----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 104133)
    Time Spent: 50m  (was: 40m)

> Support job+artifact APIs locally
> ---------------------------------
>
>                 Key: BEAM-2885
>                 URL: https://issues.apache.org/jira/browse/BEAM-2885
>             Project: Beam
>          Issue Type: Sub-task
>          Components: runner-dataflow
>            Reporter: Henning Rohde
>            Assignee: Thomas Groh
>            Priority: Major
>              Labels: portability
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> As per https://s.apache.org/beam-job-api, use local support for 
> submission-side. 



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

Reply via email to