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/11/10 16:46:40 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #11903: Avoid materializing list of segment files when finding a partition file during shuffle

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



##########
File path: indexing-service/src/main/java/org/apache/druid/indexing/worker/shuffle/LocalIntermediaryDataManager.java
##########
@@ -377,20 +377,14 @@ public DataSegment addSegment(String supervisorTaskId, String subTaskId, DataSeg
       final File partitionDir = new File(location.getPath(), getPartitionDirPath(supervisorTaskId, interval, bucketId));
       if (partitionDir.exists()) {
         supervisorTaskCheckTimes.put(supervisorTaskId, getExpiryTimeFromNow());
-        final File[] segmentFiles = partitionDir.listFiles();
-        if (segmentFiles == null) {
-          return Optional.empty();
+        final File segmentFile = new File(partitionDir, subTaskId);

Review comment:
       LGTM is complaining because `subTaskId` is passed in from user input. A validation check similar to the one done for `supervisorTaskId` on line 375 should suppress the warning from LGTM




-- 
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