java.lang.Object
org.apache.flink.runtime.io.network.partition.hybrid.tiered.netty.NettyConnectionReaderImpl
All Implemented Interfaces:
NettyConnectionReader

public class NettyConnectionReaderImpl extends Object implements NettyConnectionReader
The default implementation of NettyConnectionReader.
  • Constructor Details

    • NettyConnectionReaderImpl

      public NettyConnectionReaderImpl(Supplier<InputChannel> inputChannelProvider)
  • Method Details

    • peekNextBufferSubpartitionId

      public int peekNextBufferSubpartitionId() throws IOException
      Description copied from interface: NettyConnectionReader
      Returns the index of the subpartition where the next buffer locates, or -1 if there is no buffer available and the subpartition to be consumed is not determined.
      Specified by:
      peekNextBufferSubpartitionId in interface NettyConnectionReader
      Throws:
      IOException
    • readBuffer

      public Optional<Buffer> readBuffer(int subpartitionId, int segmentId)
      Description copied from interface: NettyConnectionReader
      Read a buffer from netty connection.
      Specified by:
      readBuffer in interface NettyConnectionReader
      Parameters:
      subpartitionId - the subpartition where the buffer locates.
      segmentId - segment id indicates the id of segment.
      Returns:
      Optional.empty() will be returned if there is no buffer sent from netty connection otherwise a buffer will be returned.