zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject zookeeper git commit: ZOOKEEPER-3062: mention fsync.warningthresholdms in FileTxnLog LOG.warn message
Date Wed, 01 Aug 2018 19:20:17 GMT
Repository: zookeeper
Updated Branches:
  refs/heads/master 78e4a1047 -> 7cf8035c3


ZOOKEEPER-3062: mention fsync.warningthresholdms in FileTxnLog LOG.warn message

https://issues.apache.org/jira/browse/ZOOKEEPER-3062

Author: Christine Poerschke <cpoerschke@bloomberg.net>

Reviewers: phunt@apache.org

Closes #566 from cpoerschke/master-ZOOKEEPER-3062 and squashes the following commits:

2bcccf62d [Christine Poerschke] Action code review feedback.
a2dc484d4 [Christine Poerschke] ZOOKEEPER-3062: mention fsync.warningthresholdms in FileTxnLog
LOG.warn message

Change-Id: Id675e61a9ef0b247d65eaa36bb88c8569d177c49


Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/7cf8035c
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/7cf8035c
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/7cf8035c

Branch: refs/heads/master
Commit: 7cf8035c3a5ca05bce2d183b41bf410709a5f6ee
Parents: 78e4a10
Author: Christine Poerschke <cpoerschke@bloomberg.net>
Authored: Wed Aug 1 12:19:34 2018 -0700
Committer: Patrick Hunt <phunt@apache.org>
Committed: Wed Aug 1 12:19:34 2018 -0700

----------------------------------------------------------------------
 .../org/apache/zookeeper/server/persistence/FileTxnLog.java   | 7 +++++--
 .../apache/zookeeper/server/persistence/FileTxnLogTest.java   | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/7cf8035c/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
----------------------------------------------------------------------
diff --git a/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java b/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
index 2748d85..4f0ef2a 100644
--- a/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
+++ b/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
@@ -99,6 +99,9 @@ public class FileTxnLog implements TxnLog {
 
     public static final String LOG_FILE_PREFIX = "log";
 
+    static final String FSYNC_WARNING_THRESHOLD_MS_PROPERTY = "fsync.warningthresholdms";
+    static final String ZOOKEEPER_FSYNC_WARNING_THRESHOLD_MS_PROPERTY = "zookeeper." + FSYNC_WARNING_THRESHOLD_MS_PROPERTY;
+
     /** Maximum time we allow for elapsed fsync before WARNing */
     private final static long fsyncWarningThresholdMS;
 
@@ -107,8 +110,8 @@ public class FileTxnLog implements TxnLog {
 
         /** Local variable to read fsync.warningthresholdms into */
         Long fsyncWarningThreshold;
-        if ((fsyncWarningThreshold = Long.getLong("zookeeper.fsync.warningthresholdms"))
== null)
-            fsyncWarningThreshold = Long.getLong("fsync.warningthresholdms", 1000);
+        if ((fsyncWarningThreshold = Long.getLong(ZOOKEEPER_FSYNC_WARNING_THRESHOLD_MS_PROPERTY))
== null)
+            fsyncWarningThreshold = Long.getLong(FSYNC_WARNING_THRESHOLD_MS_PROPERTY, 1000);
         fsyncWarningThresholdMS = fsyncWarningThreshold;
     }
 

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/7cf8035c/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java
----------------------------------------------------------------------
diff --git a/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java b/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java
index 7df8a76..77b7210 100644
--- a/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java
+++ b/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java
@@ -115,7 +115,7 @@ public class FileTxnLogTest  extends ZKTestCase {
     // Given ...
 
     // Set threshold to -1, as after the first commit it takes 0ms to commit to disk.
-    java.lang.System.setProperty("zookeeper.fsync.warningthresholdms", "-1");
+    java.lang.System.setProperty(FileTxnLog.ZOOKEEPER_FSYNC_WARNING_THRESHOLD_MS_PROPERTY,
"-1");
     ServerStats.Provider providerMock = mock(ServerStats.Provider.class);
     ServerStats serverStats = new ServerStats(providerMock);
 


Mime
View raw message