zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] hanm commented on a change in pull request #905: ZOOKEEPER-3359: Batch commits in the CommitProcessor
Date Wed, 17 Jul 2019 23:53:47 GMT
hanm commented on a change in pull request #905:  ZOOKEEPER-3359: Batch commits in the CommitProcessor

URL: https://github.com/apache/zookeeper/pull/905#discussion_r304645131
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/CommitProcessor.java
 ##########
 @@ -209,22 +240,26 @@ public void run() {
 
                 /*
                  * Processing up to requestsToProcess requests from the incoming
-                 * queue (queuedRequests), possibly less if a committed request
-                 * is present along with a pending local write. After the loop,
-                 * we process one committed request if commitIsWaiting.
+                 * queue (queuedRequests). Will not stop to process a commit if
+                 * maxReadBatchSize is set. After the loop a single committed
+                 * request is processed if one is waiting (or a batch of commits
+                 * if maxCommitBatchSize is set).
                  */
-                Request request = null;
+                Request request;
+                int readsQueued = 0;
 
 Review comment:
   This variable is used to count read requests that's processed (instead of being queued),
so I am not sure why we name it `readsQueued` here. This is also confusing later in the code
where we have `readsQueued++;` immediately followed by a `numReadQueuedRequests.decrementAndGet();`.
 
   
   I think `readsProcessed` would be a better name, which maps to existing `commitsProcessed`
on another side.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message