liuzqt commented on code in PR #38064:
URL: https://github.com/apache/spark/pull/38064#discussion_r1001055617
##########
core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala:
##########
@@ -42,8 +42,9 @@ import org.apache.spark.util.Utils
* buffers may also be used elsewhere then the caller is
responsible for copying
* them as needed.
*/
-private[spark] class ChunkedByteBuffer(var chunks: Array[ByteBuffer]) {
+private[spark] class ChunkedByteBuffer(var chunks: Array[ByteBuffer]) extends
Externalizable {
Review Comment:
There is no physical bytes buffer copy happening here, so the `chunks`
underlying bytes buffer are actually still modifiable outside, and I think it's
the caller's responsibility to manage the ownership. (But it is what it was,
not introduced by this PR, I think the idea of `ChunkedByteBuffer` is more like
a "view" of buffer chunks)
But this PR can guarantee that the serialization won't modify any state of
the ChunkedByteBuffer.
--
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]