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

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

                Author: ASF GitHub Bot
            Created on: 18/Apr/18 23:53
            Start Date: 18/Apr/18 23:53
    Worklog Time Spent: 10m 
      Work Description: bsidhom commented on a change in pull request #5150:  
[BEAM-4071] Add Portable Runner Job API shim
URL: https://github.com/apache/beam/pull/5150#discussion_r182601783
 
 

 ##########
 File path: 
runners/reference/java/src/main/java/org/apache/beam/runners/reference/testing/InMemoryArtifactService.java
 ##########
 @@ -0,0 +1,182 @@
+/*
+ * 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.reference.testing;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkState;
+
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import com.google.common.io.BaseEncoding;
+import com.google.protobuf.ByteString;
+import io.grpc.Status;
+import io.grpc.stub.StreamObserver;
+import java.security.MessageDigest;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.BiConsumer;
+import javax.annotation.concurrent.GuardedBy;
+import org.apache.beam.model.jobmanagement.v1.ArtifactApi.ArtifactMetadata;
+import 
org.apache.beam.model.jobmanagement.v1.ArtifactApi.CommitManifestRequest;
+import 
org.apache.beam.model.jobmanagement.v1.ArtifactApi.CommitManifestResponse;
+import org.apache.beam.model.jobmanagement.v1.ArtifactApi.PutArtifactRequest;
+import org.apache.beam.model.jobmanagement.v1.ArtifactApi.PutArtifactResponse;
+import 
org.apache.beam.model.jobmanagement.v1.ArtifactStagingServiceGrpc.ArtifactStagingServiceImplBase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO: Implement artifact retrieval.
+/** A StagingService for tests. */
+public class InMemoryArtifactService extends ArtifactStagingServiceImplBase {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(InMemoryArtifactService.class);
+
+  private final Object artifactLock = new Object();
+
+  @GuardedBy("artifactLock")
+  private final Map<ArtifactMetadata, ByteString> artifacts = 
Maps.newHashMap();
+
+  private final boolean keepArtifacts;
+
+  @GuardedBy("artifactLock")
+  private boolean committed = false;
+
+  /**
+   * Constructs an {@link InMemoryArtifactService}. If {@code keepArtifacts} 
is true, all artifacts
+   * are kept in memory as {@link ByteString ByteStrings}. Doing so is 
currently a waste of space
 
 Review comment:
   <!--thread_id:cc_182592000_t; 
commit:45db143ca889bc517b8b49ccfb278b1a28d17ddc; resolved:1-->
   <!--section:context-quote-->
   > **jkff** wrote:
   > Hm then can you just remove this parameter? If setting it to true 
currently accomplishes no useful purpose (it's fine to keep if you plan to very 
soon follow up this PR with something that makes it have a useful purpose)
   
   <!--section:body-->
   I've thought about it a bit and realized that we do not want to actually 
serve artifacts here. That functionality is better handled by a ValidatesRunner 
integration test. Removed.

----------------------------------------------------------------
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: 92305)
    Time Spent: 10.5h  (was: 10h 20m)

> Portable Runner Job API shim
> ----------------------------
>
>                 Key: BEAM-4071
>                 URL: https://issues.apache.org/jira/browse/BEAM-4071
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-core
>            Reporter: Ben Sidhom
>            Assignee: Ben Sidhom
>            Priority: Minor
>          Time Spent: 10.5h
>  Remaining Estimate: 0h
>
> There needs to be a way to execute Java-SDK pipelines against a portable job 
> server. The job server itself is expected to be started up out-of-band. The 
> "PortableRunner" should take an option indicating the Job API endpoint and 
> defer other runner configurations to the backend itself.



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

Reply via email to