chamikaramj commented on a change in pull request #15765:
URL: https://github.com/apache/beam/pull/15765#discussion_r754747414
##########
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:
Do you know how expensive this is ? Could this add a significant
overhead to the Job submission time ?
##########
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:
Is it possible to use a hash of the File path instead of file data ?
--
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]