-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24107][CORE] ChunkedByteBuffer.writeFully method has not reset the limit value #21175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
fae1814
623f26d
5ba6867
c585131
a2a82f1
217ec9d
2bc19a3
c9a6816
fa99a19
fb527c8
e78ef39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -20,8 +20,8 @@ package org.apache.spark.io | |||
| import java.nio.ByteBuffer | ||||
|
|
||||
| import com.google.common.io.ByteStreams | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add an empty line behind 22 to separate spark and third-party group. |
||||
|
|
||||
| import org.apache.spark.SparkFunSuite | ||||
| import org.apache.spark.{SparkEnv, SparkFunSuite} | ||||
| import org.apache.spark.internal.config | ||||
| import org.apache.spark.network.util.ByteArrayWritableChannel | ||||
| import org.apache.spark.util.io.ChunkedByteBuffer | ||||
|
|
||||
|
|
@@ -56,6 +56,15 @@ class ChunkedByteBufferSuite extends SparkFunSuite { | |||
| assert(chunkedByteBuffer.getChunks().head.position() === 0) | ||||
| } | ||||
|
|
||||
| test("SPARK-24107: writeFully() write buffer which is larger than bufferWriteChunkSize") { | ||||
| val bufferWriteChunkSize = Option(SparkEnv.get).map(_.conf.get(config.BUFFER_WRITE_CHUNK_SIZE)) | ||||
| .getOrElse(config.BUFFER_WRITE_CHUNK_SIZE.defaultValue.get).toInt | ||||
|
||||
| sc.conf.set("spark.default.parallelism", "4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I have added. Please check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rewrite this using:
to be safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. When channel write throw IOException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have commit this modified