You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by mi...@apache.org on 2014/09/17 07:36:02 UTC

svn commit: r1625463 - in /zookeeper/branches/branch-3.5: CHANGES.txt src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java

Author: michim
Date: Wed Sep 17 05:36:02 2014
New Revision: 1625463

URL: http://svn.apache.org/r1625463
Log:
ZOOKEEPER-2030 dynamicConfigFile should have an absolute path, not a relative
path, to the dynamic configuration file (Alexander Shraer via michim)

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

Modified: zookeeper/branches/branch-3.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/CHANGES.txt?rev=1625463&r1=1625462&r2=1625463&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.5/CHANGES.txt Wed Sep 17 05:36:02 2014
@@ -7,6 +7,9 @@ BUGFIXES:
 IMPROVEMENTS:
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)
 
+  ZOOKEEPER-2030 dynamicConfigFile should have an absolute path, not a relative
+  path, to the dynamic configuration file (Alexander Shraer via michim)
+
 Release 3.5.0 - 8/4/2014
 
 NEW FEATURES:

Modified: zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java?rev=1625463&r1=1625462&r2=1625463&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java (original)
+++ zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java Wed Sep 17 05:36:02 2014
@@ -405,6 +405,11 @@ public class QuorumPeerConfig {
                 .failForNonExistingPath()
                 .build()).create(configFileStr);
 
+        final File dynamicFile = (new VerifyingFileFactory.Builder(LOG)
+                .warnForRelativePath()
+                .failForNonExistingPath()
+                .build()).create(dynamicFileStr);
+        
         final Properties cfg = new Properties();
         FileInputStream in = new FileInputStream(configFile);
         try {
@@ -436,7 +441,7 @@ public class QuorumPeerConfig {
 
                 // updates the dynamic file pointer
                 out.write("dynamicConfigFile="
-                         .concat(dynamicFileStr)
+                         .concat(dynamicFile.getCanonicalPath())
                          .concat("\n"));
             }
         });