zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rake...@apache.org
Subject svn commit: r1595443 - in /zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
Date Sat, 17 May 2014 11:23:25 GMT
Author: rakeshr
Date: Sat May 17 11:23:25 2014
New Revision: 1595443

URL: http://svn.apache.org/r1595443
Log:
ZOOKEEPER-1864. quorumVerifier is null when creating a QuorumPeerConfig from parsing a Properties
object (Michi Mutsuzaki via rakeshr)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1595443&r1=1595442&r2=1595443&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Sat May 17 11:23:25 2014
@@ -648,6 +648,9 @@ BUGFIXES:
   ZOOKEEPER-1062. Net-ZooKeeper: Net::ZooKeeper consumes 100% cpu on wait
   (Botond Hejj via michim)
 
+  ZOOKEEPER-1864. quorumVerifier is null when creating a QuorumPeerConfig
+  from parsing a Properties object (Michi Mutsuzaki via rakeshr)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java?rev=1595443&r1=1595442&r2=1595443&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
(original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
Sat May 17 11:23:25 2014
@@ -115,21 +115,12 @@ public class QuorumPeerConfig {
             FileInputStream in = new FileInputStream(configFile);
             try {
                 cfg.load(in);
+                configFileStr = path;
             } finally {
                 in.close();
             }
             
             parseProperties(cfg);
-            
-            // backward compatibility - dynamic configuration in the same file as static
configuration params
-            // see writeDynamicConfig() - we change the config file to new format if reconfig
happens
-            if (dynamicConfigFileStr == null) {
-                configBackwardCompatibilityMode = true;
-                configFileStr = path;                
-                quorumVerifier = parseDynamicConfig(cfg, electionAlg, true, configBackwardCompatibilityMode);
-                checkValidity();                
-            }
-
         } catch (IOException e) {
             throw new ConfigException("Error processing " + path, e);
         } catch (IllegalArgumentException e) {
@@ -288,6 +279,16 @@ public class QuorumPeerConfig {
             throw new IllegalArgumentException(
                     "minSessionTimeout must not be larger than maxSessionTimeout");
         }          
+
+        // backward compatibility - dynamic configuration in the same file as
+        // static configuration params see writeDynamicConfig() - we change the
+        // config file to new format if reconfig happens
+        if (dynamicConfigFileStr == null) {
+            configBackwardCompatibilityMode = true;
+            quorumVerifier = parseDynamicConfig(zkProp, electionAlg, true,
+                configBackwardCompatibilityMode);
+            checkValidity();
+        }
     }
     
     /**



Mime
View raw message