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

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

                Author: ASF GitHub Bot
            Created on: 09/Jun/20 16:36
            Start Date: 09/Jun/20 16:36
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on a change in pull request #11932:
URL: https://github.com/apache/beam/pull/11932#discussion_r437009347



##########
File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/artifact/ArtifactRetrievalService.java
##########
@@ -89,34 +92,41 @@ public void resolveArtifacts(
   public void getArtifact(
       ArtifactApi.GetArtifactRequest request,
       StreamObserver<ArtifactApi.GetArtifactResponse> responseObserver) {
-    switch (request.getArtifact().getTypeUrn()) {
+    try {
+      InputStream inputStream = getArtifact(request.getArtifact());
+      byte[] buffer = new byte[bufferSize];
+      int bytesRead;
+      while ((bytesRead = inputStream.read(buffer)) > 0) {
+        responseObserver.onNext(
+            ArtifactApi.GetArtifactResponse.newBuilder()
+                .setData(ByteString.copyFrom(buffer, 0, bytesRead))
+                .build());
+      }
+      responseObserver.onCompleted();
+    } catch (IOException exn) {
+      exn.printStackTrace();
+      responseObserver.onError(exn);

Review comment:
       onError will do its own wrapping (and there's not really a 
significaintly appropriate status to return here). 




----------------------------------------------------------------
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: 443152)
    Time Spent: 24h 50m  (was: 24h 40m)

> Update artifact staging and retrieval protocols to be dependency aware.
> -----------------------------------------------------------------------
>
>                 Key: BEAM-9577
>                 URL: https://issues.apache.org/jira/browse/BEAM-9577
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-model
>            Reporter: Robert Bradshaw
>            Assignee: Robert Bradshaw
>            Priority: P2
>          Time Spent: 24h 50m
>  Remaining Estimate: 0h
>




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

Reply via email to