You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/06/08 17:13:30 UTC

[GitHub] [pinot] jasperjiaguo commented on a diff in pull request #8753: [WIP][Not ready for review] Streamed segment download & untar with rate limiter to control disk usage `feature`

jasperjiaguo commented on code in PR #8753:
URL: https://github.com/apache/pinot/pull/8753#discussion_r892652553


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/TarGzCompressionUtils.java:
##########
@@ -163,8 +182,12 @@ public static List<File> untar(InputStream inputStream, File outputDir)
           if (!parentFile.isDirectory() && !parentFile.mkdirs()) {
             throw new IOException(String.format("Failed to create directory: %s", parentFile));
           }
-          try (OutputStream out = Files.newOutputStream(outputFile.toPath())) {
-            IOUtils.copy(tarGzIn, out);
+          try (FileOutputStream out = new FileOutputStream(outputFile.toPath().toString())) {

Review Comment:
   Because we need to get the FileDescriptor from the `FileOutputStream` in `streamCopyWithRateLimiter`. Creating a FileOutputStream from `outputFile` should be safe here.



-- 
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@pinot.apache.org

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


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