dongjoon-hyun commented on code in PR #51918:
URL: https://github.com/apache/spark/pull/51918#discussion_r2263313498


##########
core/src/main/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriter.java:
##########
@@ -404,7 +403,7 @@ private void mergeSpillsWithFileStream(
                   partitionInputStream = 
compressionCodec.compressedInputStream(
                       partitionInputStream);
                 }
-                ByteStreams.copy(partitionInputStream, partitionOutput);
+                partitionInputStream.transferTo(partitionOutput);

Review Comment:
   Here is the code path. Apache Spark uses `FileChannel. transferTo` 
(Traditional API). Currently, I'm focusing on `InputStream.transferTo` (Java 
9+) API, @yaooqinn .
   
   
https://github.com/apache/spark/blob/16b70baa67d057b2c8c8df8009062c86189609cd/common/utils/src/main/scala/org/apache/spark/util/SparkStreamUtils.scala#L71-L84



##########
core/src/main/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriter.java:
##########
@@ -404,7 +403,7 @@ private void mergeSpillsWithFileStream(
                   partitionInputStream = 
compressionCodec.compressedInputStream(
                       partitionInputStream);
                 }
-                ByteStreams.copy(partitionInputStream, partitionOutput);
+                partitionInputStream.transferTo(partitionOutput);

Review Comment:
   Here is the code path. Apache Spark uses `FileChannel.transferTo` 
(Traditional API). Currently, I'm focusing on `InputStream.transferTo` (Java 
9+) API, @yaooqinn .
   
   
https://github.com/apache/spark/blob/16b70baa67d057b2c8c8df8009062c86189609cd/common/utils/src/main/scala/org/apache/spark/util/SparkStreamUtils.scala#L71-L84



-- 
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