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

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

                Author: ASF GitHub Bot
            Created on: 30/Sep/19 20:32
            Start Date: 30/Sep/19 20:32
    Worklog Time Spent: 10m 
      Work Description: ibzib commented on pull request #9681: [BEAM-8312] 
ArtifactRetrievalService serving artifacts from jar.
URL: https://github.com/apache/beam/pull/9681#discussion_r329758955
 
 

 ##########
 File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/artifact/BeamFileSystemArtifactRetrievalService.java
 ##########
 @@ -53,129 +36,45 @@
  * the artifact layout and retrieval token format produced by {@link
  * BeamFileSystemArtifactStagingService}.
  */
-public class BeamFileSystemArtifactRetrievalService
-    extends ArtifactRetrievalServiceGrpc.ArtifactRetrievalServiceImplBase
-    implements ArtifactRetrievalService {
+public class BeamFileSystemArtifactRetrievalService extends 
AbstractArtifactRetrievalService {
   private static final Logger LOG =
       LoggerFactory.getLogger(BeamFileSystemArtifactRetrievalService.class);
 
-  private static final int ARTIFACT_CHUNK_SIZE_BYTES = 2 << 20; // 2MB
+  private static final Cache<String, ArtifactApi.ProxyManifest> MANIFEST_CACHE 
=
+      CacheBuilder.newBuilder()
+          .expireAfterAccess(1, TimeUnit.HOURS /* arbitrary */)
+          .maximumSize(100 /* arbitrary */)
+          .build();
+
+  public BeamFileSystemArtifactRetrievalService() {
+    super(MANIFEST_CACHE);
+  }
 
   public static BeamFileSystemArtifactRetrievalService create() {
     return new BeamFileSystemArtifactRetrievalService();
   }
 
   @Override
-  public void getManifest(
-      ArtifactApi.GetManifestRequest request,
-      StreamObserver<ArtifactApi.GetManifestResponse> responseObserver) {
-    final String token = request.getRetrievalToken();
-    if (Strings.isNullOrEmpty(token)) {
-      throw new StatusRuntimeException(
-          Status.INVALID_ARGUMENT.withDescription("Empty artifact token"));
-    }
+  public InputStream openUri(String retrievalToken, String uri) throws 
IOException {
+    ResourceId artifactResourceId = FileSystems.matchNewResource(uri, false /* 
is directory */);
 
 Review comment:
   Nit: I know this was like this before, but "is directory" is ambiguous -- is 
this trying to say "false, meaning it's a directory," or "is directory = false"?
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 320838)

> Flink portable pipeline jars do not need to stage artifacts remotely
> --------------------------------------------------------------------
>
>                 Key: BEAM-8312
>                 URL: https://issues.apache.org/jira/browse/BEAM-8312
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-flink
>            Reporter: Kyle Weaver
>            Assignee: Kyle Weaver
>            Priority: Major
>              Labels: portability-flink
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently, Flink job jars re-stage all artifacts at runtime (on the 
> JobManager) by using the usual BeamFileSystemArtifactRetrievalService [1]. 
> However, since the manifest and all the artifacts live on the classpath of 
> the jar, and everything from the classpath is copied to the Flink workers 
> anyway [2], it should not be necessary to do additional artifact staging. We 
> could replace BeamFileSystemArtifactRetrievalService in this case with a 
> simple ArtifactRetrievalService that just pulls the artifacts from the 
> classpath.
>  
>  [1] 
> [https://github.com/apache/beam/blob/340c3202b1e5824b959f5f9f626e4c7c7842a3cb/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/artifact/BeamFileSystemArtifactRetrievalService.java]
> [2] 
> [https://github.com/apache/beam/blob/2f1b56ccc506054e40afe4793a8b556e872e1865/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkExecutionEnvironments.java#L93]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to