Class NettyConnectionWriterImpl
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.hybrid.tiered.netty.NettyConnectionWriterImpl
-
- All Implemented Interfaces:
NettyConnectionWriter
public class NettyConnectionWriterImpl extends Object implements NettyConnectionWriter
The default implementation ofNettyConnectionWriter.
-
-
Constructor Summary
Constructors Constructor Description NettyConnectionWriterImpl(NettyPayloadManager nettyPayloadManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(Throwable error)If error is null, remove and recycle all buffers in the writer.NettyConnectionIdgetNettyConnectionId()Get the id of connection in the writer.voidnotifyAvailable()Notify the buffer is available in writer.intnumQueuedBufferPayloads()Get the number of written but unsent buffer netty payloads.intnumQueuedPayloads()Get the number of written but unsent netty payloads.voidregisterAvailabilityListener(Runnable availabilityListener)voidwriteNettyPayload(NettyPayload nettyPayload)Write a buffer to netty connection.
-
-
-
Constructor Detail
-
NettyConnectionWriterImpl
public NettyConnectionWriterImpl(NettyPayloadManager nettyPayloadManager)
-
-
Method Detail
-
registerAvailabilityListener
public void registerAvailabilityListener(Runnable availabilityListener)
-
getNettyConnectionId
public NettyConnectionId getNettyConnectionId()
Description copied from interface:NettyConnectionWriterGet the id of connection in the writer.- Specified by:
getNettyConnectionIdin interfaceNettyConnectionWriter- Returns:
- the id of connection.
-
notifyAvailable
public void notifyAvailable()
Description copied from interface:NettyConnectionWriterNotify the buffer is available in writer.- Specified by:
notifyAvailablein interfaceNettyConnectionWriter
-
numQueuedPayloads
public int numQueuedPayloads()
Description copied from interface:NettyConnectionWriterGet the number of written but unsent netty payloads.- Specified by:
numQueuedPayloadsin interfaceNettyConnectionWriter- Returns:
- the buffer number.
-
numQueuedBufferPayloads
public int numQueuedBufferPayloads()
Description copied from interface:NettyConnectionWriterGet the number of written but unsent buffer netty payloads.- Specified by:
numQueuedBufferPayloadsin interfaceNettyConnectionWriter- Returns:
- the buffer number.
-
writeNettyPayload
public void writeNettyPayload(NettyPayload nettyPayload)
Description copied from interface:NettyConnectionWriterWrite a buffer to netty connection.- Specified by:
writeNettyPayloadin interfaceNettyConnectionWriter- Parameters:
nettyPayload- the payload send to netty connection.
-
close
public void close(@Nullable Throwable error)Description copied from interface:NettyConnectionWriterIf error is null, remove and recycle all buffers in the writer. If error is not null, the error will be written after all buffers are removed and recycled.- Specified by:
closein interfaceNettyConnectionWriter- Parameters:
error- error represents the exception information.
-
-