Interface NettyConnectionWriter
-
- All Known Implementing Classes:
NettyConnectionWriterImpl
public interface NettyConnectionWriterNettyConnectionWriteris used byTierProducerAgentto write buffers to netty connection. Buffers in the writer will be written to a queue structure and netty server will send buffers from it.
-
-
Method Summary
All Methods Instance Methods Abstract 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.voidwriteNettyPayload(NettyPayload nettyPayload)Write a buffer to netty connection.
-
-
-
Method Detail
-
writeNettyPayload
void writeNettyPayload(NettyPayload nettyPayload)
Write a buffer to netty connection.- Parameters:
nettyPayload- the payload send to netty connection.
-
getNettyConnectionId
NettyConnectionId getNettyConnectionId()
Get the id of connection in the writer.- Returns:
- the id of connection.
-
notifyAvailable
void notifyAvailable()
Notify the buffer is available in writer.
-
numQueuedPayloads
int numQueuedPayloads()
Get the number of written but unsent netty payloads.- Returns:
- the buffer number.
-
numQueuedBufferPayloads
int numQueuedBufferPayloads()
Get the number of written but unsent buffer netty payloads.- Returns:
- the buffer number.
-
close
void close(@Nullable Throwable error)If 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.- Parameters:
error- error represents the exception information.
-
-