Class BoundedNettyByteBufReceive

  • All Implemented Interfaces:
    io.netty.buffer.ByteBufHolder, io.netty.util.ReferenceCounted

    public class BoundedNettyByteBufReceive
    extends com.github.ambry.utils.AbstractByteBufHolder<BoundedNettyByteBufReceive>
    A netty ByteBuf version of Receive to buffer the incoming request or response.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.netty.buffer.ByteBuf content()  
      boolean isReadComplete()  
      long readFrom​(java.nio.channels.ReadableByteChannel channel)  
      BoundedNettyByteBufReceive replace​(io.netty.buffer.ByteBuf content)  
      long sizeRead()
      The total size in bytes that needs to receive from the channel It will be initialized only after header is read.
      • Methods inherited from class com.github.ambry.utils.AbstractByteBufHolder

        copy, duplicate, refCnt, release, release, retain, retain, retainedDuplicate, touch, touch
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BoundedNettyByteBufReceive

        public BoundedNettyByteBufReceive()
    • Method Detail

      • isReadComplete

        public boolean isReadComplete()
      • readFrom

        public long readFrom​(java.nio.channels.ReadableByteChannel channel)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • sizeRead

        public long sizeRead()
        The total size in bytes that needs to receive from the channel It will be initialized only after header is read.
        Returns:
        the size of the data in bytes to receive after reading header, otherwise return 0
      • content

        public io.netty.buffer.ByteBuf content()
        Specified by:
        content in interface io.netty.buffer.ByteBufHolder
        Specified by:
        content in class com.github.ambry.utils.AbstractByteBufHolder<BoundedNettyByteBufReceive>
      • replace

        public BoundedNettyByteBufReceive replace​(io.netty.buffer.ByteBuf content)
        Specified by:
        replace in interface io.netty.buffer.ByteBufHolder
        Specified by:
        replace in class com.github.ambry.utils.AbstractByteBufHolder<BoundedNettyByteBufReceive>