Interface NettyConnectionWriter
- All Known Implementing Classes:
NettyConnectionWriterImpl
public interface NettyConnectionWriter
NettyConnectionWriter is used by TierProducerAgent to 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
Modifier and TypeMethodDescriptionvoidIf error is null, remove and recycle all buffers in the writer.Get the id of connection in the writer.voidNotify the buffer is available in writer.intGet the number of written but unsent buffer netty payloads.intGet the number of written but unsent netty payloads.voidwriteNettyPayload(NettyPayload nettyPayload) Write a buffer to netty connection.
-
Method Details
-
writeNettyPayload
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
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.
-