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_r304672677
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/CommitProcessor.java
 ##########
 @@ -82,13 +83,26 @@
     /** Default worker pool shutdown timeout in ms: 5000 (5s) */
     public static final String ZOOKEEPER_COMMIT_PROC_SHUTDOWN_TIMEOUT =
         "zookeeper.commitProcessor.shutdownTimeout";
+    /** Default max read batch size: -1 to disable the feature */
+    public static final String ZOOKEEPER_COMMIT_PROC_MAX_READ_BATCH_SIZE =
+        "zookeeper.commitProcessor.maxReadBatchSize";
+    /** Default max commit batch size: 1 */
+    public static final String ZOOKEEPER_COMMIT_PROC_MAX_COMMIT_BATCH_SIZE =
+        "zookeeper.commitProcessor.maxCommitBatchSize";
 
     /**
      * Incoming requests.
      */
     protected LinkedBlockingQueue<Request> queuedRequests =
         new LinkedBlockingQueue<Request>();
 
+    /**
+     * Incoming requests that are waiting on a commit,
+     * contained in order of arrival
+     */
+    protected final LinkedBlockingQueue<Request> blockedRequestQueue =
 
 Review comment:
   I fee rename this variable to `queuedWriteRequests` will lead to less cognitive overhead
while reading this code:
   
   * It's explicit about the type of requests: not all requests that are "blocked" are queued
here; only write requests are queued. Blocked read requests (which are blocked because their
session has prior write requests waiting for commit) are not here (this is why I was confused
on the name "blocked" in first place.).
   
   * It's consistent with existing metrics `numWriteQueuedRequests` and various comments in
code (where they mentioned "write requests" directly).

----------------------------------------------------------------
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