You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/10/14 13:24:33 UTC

[GitHub] [spark] srowen commented on a change in pull request #34284: [SPARK-36900][CORE][TEST] Refactor `SPARK-36464: size returns correct positive number even with over 2GB data` to pass with Java 8, 11 and 17

srowen commented on a change in pull request #34284:
URL: https://github.com/apache/spark/pull/34284#discussion_r728979347



##########
File path: core/src/test/scala/org/apache/spark/util/io/ChunkedByteBufferOutputStreamSuite.scala
##########
@@ -121,12 +121,10 @@ class ChunkedByteBufferOutputStreamSuite extends SparkFunSuite {
   }
 
   test("SPARK-36464: size returns correct positive number even with over 2GB data") {
-    val ref = new Array[Byte](1024 * 1024 * 1024)
-    val o = new ChunkedByteBufferOutputStream(1024 * 1024, ByteBuffer.allocate)
-    o.write(ref)
-    o.write(ref)
-    o.close()
+    val ref = new Array[Byte](1024 * 1024 * 4)
+    val o = new ChunkedByteBufferOutputStream(1024 * 1024 * 4, ByteBuffer.allocate)
+    (0 to 512).foreach(_ => o.write(ref))

Review comment:
       OK this writes 513 times right? sounds good. is o.close() important? probably not but could keep it.
   If you change again, maybe introduce a constant for "4" and some expressions to demonstrate the logic here of writing just over 2G, but, it doesn't matter




-- 
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: reviews-unsubscribe@spark.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org