zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anmolnar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #567: ZOOKEEPER-3071: Add a config parameter to contr...
Date Fri, 13 Jul 2018 14:41:39 GMT
Github user anmolnar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/567#discussion_r202364713
  
    --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java ---
    @@ -347,6 +397,13 @@ public synchronized void commit() throws IOException {
             while (streamsToFlush.size() > 1) {
                 streamsToFlush.removeFirst().close();
             }
    +
    +        // Roll the log file if we exceed the size limit
    +        long logSize = getCurrentLogSize();
    --- End diff --
    
    Please change the order of the if conditions. You probably don't want to calculate the
current log file size if the feature is disabled. Probably not a big deal performance-wise,
but I think it's cleaner code.


---

Mime
View raw message