zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1746511 - in /zookeeper/trunk: ./ src/java/main/org/apache/zookeeper/server/quorum/ src/java/test/org/apache/zookeeper/test/
Date Wed, 01 Jun 2016 22:59:25 GMT
Author: phunt
Date: Wed Jun  1 22:59:24 2016
New Revision: 1746511

URL: http://svn.apache.org/viewvc?rev=1746511&view=rev
Log:
ZOOKEEPER-2410: add time unit to 'ELECTION TOOK' log.info message (Christine Poerschke via
phunt)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java
    zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java
    zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1746511&r1=1746510&r2=1746511&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Wed Jun  1 22:59:24 2016
@@ -425,6 +425,9 @@ IMPROVEMENTS:
 
   ZOOKEEPER-2402: Document client side properties (Arshad Mohammad via fpj)
 
+  ZOOKEEPER-2410: add time unit to 'ELECTION TOOK' log.info message
+  (Christine Poerschke via phunt)
+
 Release 3.5.0 - 8/4/2014
 
 NEW FEATURES:

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java?rev=1746511&r1=1746510&r2=1746511&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java Wed Jun
 1 22:59:24 2016
@@ -64,7 +64,7 @@ public class Follower extends Learner{
     void followLeader() throws InterruptedException {
         self.end_fle = Time.currentElapsedTime();
         LOG.info("FOLLOWING - LEADER ELECTION TOOK - " +
-              (self.end_fle - self.start_fle));
+              (self.end_fle - self.start_fle) + " " + QuorumPeer.FLE_TIME_UNIT);
         self.start_fle = 0;
         self.end_fle = 0;
         fzk.registerJMX(new FollowerBean(this, zk), self.jmxLocalPeerBean);

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java?rev=1746511&r1=1746510&r2=1746511&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java Wed Jun 
1 22:59:24 2016
@@ -410,7 +410,7 @@ public class Leader {
     void lead() throws IOException, InterruptedException {
         self.end_fle = Time.currentElapsedTime();
         LOG.info("LEADING - LEADER ELECTION TOOK - " +
-              (self.end_fle - self.start_fle));
+              (self.end_fle - self.start_fle) + " " + QuorumPeer.FLE_TIME_UNIT);
         self.start_fle = 0;
         self.end_fle = 0;
 

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java?rev=1746511&r1=1746510&r2=1746511&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java Wed Jun
 1 22:59:24 2016
@@ -395,7 +395,8 @@ public class QuorumPeer extends ZooKeepe
     /*
      * Record leader election time
      */
-    public long start_fle, end_fle;
+    public long start_fle, end_fle; // fle = fast leader election
+    public static final String FLE_TIME_UNIT = "MS";
 
     /*
      * Default value of peer is participant

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java?rev=1746511&r1=1746510&r2=1746511&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java Wed Jun  1 22:59:24
2016
@@ -528,4 +528,9 @@ public class FLETest extends ZKTestCase
             }
         }
     }
+
+    @Test
+    public void testElectionTimeUnit() throws Exception {
+        Assert.assertEquals("MS", QuorumPeer.FLE_TIME_UNIT);
+    }
 }



Mime
View raw message