swaminathanmanish commented on code in PR #15030: URL: https://github.com/apache/pinot/pull/15030#discussion_r1952215580
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/SegmentPushUtils.java: ########## @@ -458,10 +438,71 @@ 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) { + int nThreads = spec.getPushJobSpec().getSegmentMetadataGenerationParallelism(); Review Comment: Could you add a comment on why we are doing this. For segments not local, we have to download them to extract metadata file. ########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/SegmentPushUtils.java: ########## @@ -458,10 +438,71 @@ 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) { + int nThreads = spec.getPushJobSpec().getSegmentMetadataGenerationParallelism(); Review Comment: I assume this would take care . I guess the only usecase for this param is to do a metadata push for segments already in Deep store. int _segmentMetadataGenerationParallelism = 1; -- 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