swaminathanmanish commented on code in PR #15030: URL: https://github.com/apache/pinot/pull/15030#discussion_r1950984500
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/SegmentPushUtils.java: ########## @@ -458,10 +438,70 @@ public static void sendSegmentsUriAndMetadata(SegmentGenerationJobSpec spec, Pin }); } } finally { - for (Map.Entry<String, File> metadataFileEntry: segmentMetadataFileMap.entrySet()) { + for (Map.Entry<String, File> metadataFileEntry : segmentMetadataFileMap.entrySet()) { FileUtils.deleteQuietly(metadataFileEntry.getValue()); } - FileUtils.forceDelete(allSegmentsMetadataTarFile); + if (allSegmentsMetadataTarFile != null) { + FileUtils.deleteQuietly(allSegmentsMetadataTarFile); + } + } + } + + @VisibleForTesting + public static void generateSegmentMetadataFiles(SegmentGenerationJobSpec spec, PinotFS fileSystem, + Map<String, String> segmentUriToTarPathMap, ConcurrentHashMap<String, File> segmentMetadataFileMap, + ConcurrentLinkedQueue<String> segmentURIs) { + ExecutorService executor = Executors.newFixedThreadPool(spec.getPushJobSpec().getPushParallelism()); + List<Future<Void>> futures = new ArrayList<>(); + + for (String segmentUriPath : segmentUriToTarPathMap.keySet()) { Review Comment: @abhishekbafna - Is the main reason for this optimization to parallelize downloads from Deep store? fileSystem.copyToLocalFile(tarFileURI, tarFile); I think intention of pushParallelism feature was to push multiple segments to the controller in parallel. This is when we did not have metadata push and segments had to be uploaded to controller. pushParallelism is no longer relevant post metadata push. -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org