attilapiros commented on a change in pull request #22024: [SPARK-25034][CORE] 
Remove allocations in onBlockFetchSuccess
URL: https://github.com/apache/spark/pull/22024#discussion_r257675415
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala
 ##########
 @@ -172,10 +172,16 @@ private[spark] class ChunkedByteBuffer(var chunks: 
Array[ByteBuffer]) {
 
 object ChunkedByteBuffer {
   // TODO eliminate this method if we switch BlockManager to getting 
InputStreams
-  def fromManagedBuffer(data: ManagedBuffer, maxChunkSize: Int): 
ChunkedByteBuffer = {
+  def fromManagedBuffer(data: ManagedBuffer, maxChunkSizeForFileBuffer: Int): 
ChunkedByteBuffer = {
 
 Review comment:
   Just an idea: moving the `fromManagedBuffer` functionality into a method of 
`ManagedBuffer` and its subclasses. I.e. to `toChunkedByteBuffer()`.
   
   This way a new method `nioByteBuffers` is not needed. Moreover in 
`NettyManagedBuffer` you can check the `buf.nioBufferCount()` and depending on 
its value you can use either use `nioBuffers()` or `nioBuffer()`. 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to