ihji commented on a change in pull request #15765:
URL: https://github.com/apache/beam/pull/15765#discussion_r763523127
##########
File path:
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
##########
@@ -870,16 +873,26 @@ private Debuggee registerDebuggee(CloudDebugger
debuggerClient, String uniquifie
} catch (InvalidProtocolBufferException e) {
throw new RuntimeException("Error parsing artifact file payload.",
e);
}
- if (!BeamUrns.getUrn(RunnerApi.StandardArtifacts.Roles.STAGING_TO)
+ String stagedName;
+ if (BeamUrns.getUrn(RunnerApi.StandardArtifacts.Roles.STAGING_TO)
.equals(info.getRoleUrn())) {
- throw new RuntimeException(
- String.format("unsupported artifact role %s",
info.getRoleUrn()));
- }
- RunnerApi.ArtifactStagingToRolePayload stagingPayload;
- try {
- stagingPayload =
RunnerApi.ArtifactStagingToRolePayload.parseFrom(info.getRolePayload());
- } catch (InvalidProtocolBufferException e) {
- throw new RuntimeException("Error parsing artifact staging_to role
payload.", e);
+ try {
+ RunnerApi.ArtifactStagingToRolePayload stagingPayload =
+
RunnerApi.ArtifactStagingToRolePayload.parseFrom(info.getRolePayload());
+ stagedName = stagingPayload.getStagedName();
+ } catch (InvalidProtocolBufferException e) {
+ throw new RuntimeException("Error parsing artifact staging_to role
payload.", e);
+ }
+ } else {
+ try {
+ File source = new File(filePayload.getPath());
+ HashCode hashCode =
Files.asByteSource(source).hash(Hashing.sha256());
Review comment:
I think this won't increase the job submission time since it only covers
exceptional cases. In principle, all Java artifacts for Dataflow runner should
have staging_to locations however some Python system artifacts like
`pickled_main` don't have staging_to information so they need a special care in
Java SDK (Python SDK handles them properly but not Java SDK).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]