You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/06/26 20:24:10 UTC

[GitHub] [beam] lukecwik commented on a change in pull request #11938: [BEAM-9577] Remove uses of legacy artifact service in Java.

lukecwik commented on a change in pull request #11938:
URL: https://github.com/apache/beam/pull/11938#discussion_r446390607



##########
File path: runners/portability/java/src/main/java/org/apache/beam/runners/portability/PortableRunner.java
##########
@@ -188,43 +178,24 @@ public PipelineResult run(Pipeline pipeline) {
           prepareJobResponse.getArtifactStagingEndpoint();
       String stagingSessionToken = prepareJobResponse.getStagingSessionToken();
 
-      List<StagedFile> filesToStage = createFilesToStage(pipelineProto);
-
-      String retrievalToken = null;
       try (CloseableResource<ManagedChannel> artifactChannel =
           CloseableResource.of(
               channelFactory.forDescriptor(artifactStagingEndpoint), ManagedChannel::shutdown)) {
 
-        LOG.debug("Actual files staged: {}", filesToStage);
-        try {
-          ArtifactStagingService.offer(
-              new ArtifactRetrievalService(),
-              ArtifactStagingServiceGrpc.newStub(artifactChannel.get()),
-              stagingSessionToken);
-          retrievalToken = "";
-        } catch (ExecutionException exn) {
-          if (exn.getCause() instanceof StatusRuntimeException
-              && ((StatusRuntimeException) exn.getCause()).getStatus().getCode()
-                  == Status.Code.UNIMPLEMENTED) {
-            // Attempt legacy staging.
-            ArtifactServiceStager stager = ArtifactServiceStager.overChannel(artifactChannel.get());
-            retrievalToken = stager.stage(stagingSessionToken, filesToStage);
-          } else {
-            throw exn;
-          }
-        }
+        ArtifactStagingService.offer(
+            new ArtifactRetrievalService(),
+            ArtifactStagingServiceGrpc.newStub(artifactChannel.get()),
+            stagingSessionToken);
       } catch (CloseableResource.CloseException e) {
         LOG.warn("Error closing artifact staging channel", e);
         // CloseExceptions should only be thrown while closing the channel.
-        checkState(retrievalToken != null);
       } catch (Exception e) {
         throw new RuntimeException("Error staging files.", e);
       }
 
       RunJobRequest runJobRequest =
           RunJobRequest.newBuilder()
               .setPreparationId(prepareJobResponse.getPreparationId())
-              .setRetrievalToken(retrievalToken)

Review comment:
       As a followup I'm assuming we can finally deprecate the retrieval token field from the proto and the few places it still exists.




----------------------------------------------------------------
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:
users@infra.apache.org