zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afine <...@git.apache.org>
Subject [GitHub] zookeeper pull request #296: ZOOKEEPER-2824: `FileChannel#size` info should ...
Date Thu, 29 Jun 2017 20:36:44 GMT
Github user afine commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/296#discussion_r124906442
  
    --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java ---
    @@ -332,11 +333,13 @@ public synchronized void commit() throws IOException {
                 if (forceSync) {
                     long startSyncNS = System.nanoTime();
     
    -                log.getChannel().force(false);
    +                FileChannel channel = log.getChannel();
    +                channel.force(false);
     
                     syncElapsedMS = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS);
                     if (syncElapsedMS > fsyncWarningThresholdMS) {
    -                    LOG.warn("fsync-ing the write ahead log in "
    +                    LOG.warn("fsync-ing the write ahead log ("
    +                            + channel.size() + " bytes) in "
    --- End diff --
    
    According to the javadoc, `size()` returns "Returns the current size of this channel's
file." Can you explain why this is valuable?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message