hangc0276 commented on code in PR #3846:
URL: https://github.com/apache/bookkeeper/pull/3846#discussion_r1137996730
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestHandler.java:
##########
@@ -34,20 +40,24 @@
*/
@Slf4j
public class BookieRequestHandler extends ChannelInboundHandlerAdapter {
-
+ private static final int DEFAULT_CAPACITY = 1_000;
static final Object EVENT_FLUSH_ALL_PENDING_RESPONSES = new Object();
private final RequestProcessor requestProcessor;
private final ChannelGroup allChannels;
private ChannelHandlerContext ctx;
+ private final BlockingQueue<BookieProtocol.ParsedAddRequest> msgs;
private ByteBuf pendingSendResponses = null;
private int maxPendingResponsesSize;
BookieRequestHandler(ServerConfiguration conf, RequestProcessor processor,
ChannelGroup allChannels) {
this.requestProcessor = processor;
this.allChannels = allChannels;
+
+ int maxCapacity = conf.getMaxAddsInProgressLimit() > 0 ?
conf.getMaxAddsInProgressLimit() : DEFAULT_CAPACITY;
+ this.msgs = new ArrayBlockingQueue<>(maxCapacity);
Review Comment:
I think maybe not. The megs queue is also controlled by the Netty request
handle. Netty also has a read batch control and once the batch limit is
reached, it will call `channelReadComplete`, and we will flush the msgs queue
requests to the storage when the `channelReadComplete` is called.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]