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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to