Class NettyConnectionReaderImpl
- 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 ofNettyConnectionReader.
-
-
Constructor Summary
Constructors Constructor Description NettyConnectionReaderImpl(Supplier<InputChannel> inputChannelProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intpeekNextBufferSubpartitionId()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.Optional<Buffer>readBuffer(int subpartitionId, int segmentId)Read a buffer from netty connection.
-
-
-
Constructor Detail
-
NettyConnectionReaderImpl
public NettyConnectionReaderImpl(Supplier<InputChannel> inputChannelProvider)
-
-
Method Detail
-
peekNextBufferSubpartitionId
public int peekNextBufferSubpartitionId() throws IOExceptionDescription copied from interface:NettyConnectionReaderReturns 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:
peekNextBufferSubpartitionIdin interfaceNettyConnectionReader- Throws:
IOException
-
readBuffer
public Optional<Buffer> readBuffer(int subpartitionId, int segmentId)
Description copied from interface:NettyConnectionReaderRead a buffer from netty connection.- Specified by:
readBufferin interfaceNettyConnectionReader- 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.
-
-