You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/07/26 18:38:34 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #11492: Make intermediate store for shuffle tasks an extension point

suneet-s commented on a change in pull request #11492:
URL: https://github.com/apache/druid/pull/11492#discussion_r676851268



##########
File path: indexing-service/src/main/java/org/apache/druid/indexing/worker/shuffle/ShuffleResource.java
##########
@@ -98,14 +96,19 @@ public Response getPartition(
       );
       return Response.status(Status.NOT_FOUND).entity(errorMessage).build();
     } else {
-      shuffleMetrics.ifPresent(metrics -> metrics.shuffleRequested(supervisorTaskId, partitionFile.length()));
-      return Response.ok(
-          (StreamingOutput) output -> {
-            try (final FileInputStream fileInputStream = new FileInputStream(partitionFile)) {
-              ByteStreams.copy(fileInputStream, output);
-            }
-          }
-      ).build();
+      try {
+        long size = partitionFile.get().size();

Review comment:
       This will potentially read the entire file to get the size. I believe `partitionFile.length()` is just a metadata lookup on the file to get the length.




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org