xiangfu0 commented on code in PR #10034: URL: https://github.com/apache/pinot/pull/10034#discussion_r1059219609
########## pinot-plugins/pinot-batch-ingestion/pinot-batch-ingestion-hadoop/src/main/java/org/apache/pinot/plugin/ingestion/batch/hadoop/HadoopSegmentCreationMapper.java: ########## @@ -183,13 +184,24 @@ protected void map(LongWritable key, Text value, Context context) { LOGGER.info("Size for segment: {}, uncompressed: {}, compressed: {}", segmentName, DataSizeUtils.fromBytes(uncompressedSegmentSize), DataSizeUtils.fromBytes(compressedSegmentSize)); //move segment to output PinotFS - URI outputSegmentTarURI = SegmentGenerationUtils.getRelativeOutputPath(inputDirURI, inputFileURI, outputDirURI) - .resolve(segmentTarFileName); - LOGGER.info("Copying segment tar file from [{}] to [{}]", localSegmentTarFile, outputSegmentTarURI); - outputDirFS.copyFromLocalFile(localSegmentTarFile, outputSegmentTarURI); + URI relativeOutputPath = SegmentGenerationUtils.getRelativeOutputPath(inputDirURI, inputFileURI, outputDirURI); + URI outputSegmentTarURI = relativeOutputPath.resolve(segmentTarFileName); + SegmentGenerationJobUtils.moveLocalTarFileToRemote(localSegmentTarFile, outputSegmentTarURI, + _spec.isOverwriteOutput()); + + String metadataTarFileName = URLEncoder.encode(segmentName + Constants.METADATA_TAR_GZ_FILE_EXT, "UTF-8"); Review Comment: I think we will delete the metadata tar gz file once `_spec.isOverwriteOutput()` is true. Just in the case of user switch on then off the `isCreateMetadataTarGz` flag. Then this code will only generate segment tar gz and delete the metadata tar gz file. -- 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