Github user dcapwell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1907#discussion_r16133840
  
    --- Diff: 
core/src/main/scala/org/apache/spark/network/netty/ReferenceCountedBuffer.scala 
---
    @@ -17,15 +17,25 @@
     
     package org.apache.spark.network.netty
     
    -import io.netty.channel.ChannelInitializer
    -import io.netty.channel.socket.SocketChannel
    -import io.netty.handler.codec.string.StringEncoder
    +import java.io.InputStream
    +import java.nio.ByteBuffer
     
    +import io.netty.buffer.{ByteBufInputStream, ByteBuf}
     
    -class FileClientChannelInitializer(handler: FileClientHandler)
    -  extends ChannelInitializer[SocketChannel] {
     
    -  def initChannel(channel: SocketChannel) {
    -    channel.pipeline.addLast("encoder", new 
StringEncoder).addLast("handler", handler)
    -  }
    +/**
    + * A buffer abstraction based on Netty's ByteBuf.
    + *
    + * The buffer's life cycle is NOT managed by the JVM, and thus requiring 
explicit declaration of
    + * reference by the retain method and release method.
    + */
    +class ReferenceCountedBuffer(underlying: ByteBuf) {
    --- End diff --
    
    Could make this class a value class.  Based off this patch, the runtime 
wouldn't have ReferenceCountedBuffer objects created.


---
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]

Reply via email to