zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r750597 - in /hadoop/zookeeper/branches/branch-3.1: CHANGES.txt src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
Date Thu, 05 Mar 2009 21:32:19 GMT
Author: phunt
Date: Thu Mar  5 21:32:15 2009
New Revision: 750597

URL: http://svn.apache.org/viewvc?rev=750597&view=rev
Log:
ZOOKEEPER-279. Allow specialization of quorum config parsing (e.g. variable expansion in zoo.cfg)

Modified:
    hadoop/zookeeper/branches/branch-3.1/CHANGES.txt
    hadoop/zookeeper/branches/branch-3.1/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java

Modified: hadoop/zookeeper/branches/branch-3.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.1/CHANGES.txt?rev=750597&r1=750596&r2=750597&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.1/CHANGES.txt (original)
+++ hadoop/zookeeper/branches/branch-3.1/CHANGES.txt Thu Mar  5 21:32:15 2009
@@ -8,22 +8,26 @@
 
 BUGFIXES:
   
-  ZOOKEEPER-326. standalone server ignores tickTime configuration (chris
-darroch via mahadev)
+  ZOOKEEPER-326. standalone server ignores tickTime configuration
+  (chris darroch via mahadev)
 
-  ZOOKEEPER-330. zookeeper standalone server does not startup with just a port
-and datadir. (chris darroch and mahadev)
+  ZOOKEEPER-330. zookeeper standalone server does not startup with just a
+  port and datadir. (chris darroch and mahadev)
 
-  ZOOKEEPER-319. add locking around auth info in zhandle_t (chris darroch via
-mahadev)
+  ZOOKEEPER-319. add locking around auth info in zhandle_t
+  (chris darroch via mahadev)
 
-  ZOOKEEPER-320. call auth completion in free_completions(). (chris darroch
-via mahadev)
+  ZOOKEEPER-320. call auth completion in free_completions().
+  (chris darroch via mahadev)
 
 IMPROVEMENTS:
 
+  ZOOKEEPER-279. Allow specialization of quorum config parsing
+  (e.g. variable expansion in zoo.cfg) (Jean-Daniel Cryans via phunt)
+
 NEW FEATURES:
 
+
 Release 3.1.0 - 2009-02-11
   
 Non-backward compatible changes:

Modified: hadoop/zookeeper/branches/branch-3.1/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.1/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java?rev=750597&r1=750596&r2=750597&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.1/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
(original)
+++ hadoop/zookeeper/branches/branch-3.1/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
Thu Mar  5 21:32:15 2009
@@ -23,14 +23,12 @@
 import java.io.FileInputStream;
 import java.io.FileReader;
 import java.net.InetSocketAddress;
+import java.util.HashMap;
 import java.util.Properties;
 import java.util.Map.Entry;
-import java.util.HashMap;
 
 import org.apache.log4j.Logger;
-
 import org.apache.zookeeper.server.ServerConfig;
-import org.apache.zookeeper.server.ZooKeeperServer;
 import org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
 
 public class QuorumPeerConfig extends ServerConfig {
@@ -44,7 +42,9 @@
     private HashMap<Long,QuorumServer> servers = null;
     private long serverId;
 
-    private QuorumPeerConfig(int port, String dataDir, String dataLogDir, int tickTime) {
+    protected QuorumPeerConfig(int port, String dataDir, String dataLogDir,
+            int tickTime)
+    {
         super(port, dataDir, dataLogDir, tickTime);
     }
 
@@ -66,6 +66,11 @@
         } finally {
             zooCfgStream.close();
         }
+
+        parseProperties(cfg);
+    }
+
+    protected static void parseProperties(Properties zkProp) throws Exception {
         HashMap<Long, QuorumServer> servers = new HashMap<Long, QuorumServer>();
         String dataDir = null;
         String dataLogDir = null;
@@ -75,7 +80,7 @@
         int syncLimit = 0;
         int electionAlg = 3;
         int electionPort = 2182;
-        for (Entry<Object, Object> entry : cfg.entrySet()) {
+        for (Entry<Object, Object> entry : zkProp.entrySet()) {
             String key = entry.getKey().toString();
             String value = entry.getValue().toString();
             if (key.equals("dataDir")) {



Mime
View raw message