ihji commented on a change in pull request #15765:
URL: https://github.com/apache/beam/pull/15765#discussion_r763537457
##########
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:
It might be little confusing if we use a hash of the file path instead
of the file data since we already generate staging names from the file data by
[default](https://github.com/apache/beam/blob/master/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/Environments.java#L333).
I think it's not ideal if two types of staging names (from the file data, from
the file name) coexist.
--
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]