Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/11805#discussion_r58144571
--- Diff:
core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala ---
@@ -117,8 +117,10 @@ private[spark] class ChunkedByteBuffer(var chunks:
Array[ByteBuffer]) {
/**
* Make a copy of this ChunkedByteBuffer, copying all of the backing
data into new buffers.
* The new buffer will share no resources with the original buffer.
+ *
+ * @param allocator a method for allocating byte buffers
*/
- def copy(): ChunkedByteBuffer = {
+ def copy(allocator: Int => ByteBuffer): ChunkedByteBuffer = {
val copiedChunks = getChunks().map { chunk =>
// TODO: accept an allocator in this copy method to integrate with
mem. accounting systems
val newChunk = ByteBuffer.allocate(chunk.limit())
--- End diff --
Yes; good catch.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]