accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1420312 - /accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java
Date Tue, 11 Dec 2012 18:04:25 GMT
Author: kturner
Date: Tue Dec 11 18:04:24 2012
New Revision: 1420312

URL: http://svn.apache.org/viewvc?rev=1420312&view=rev
Log:
ACCUMULO-895 write zookeeper config using java.util.Properties to properly escape windows
path

Modified:
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java?rev=1420312&r1=1420311&r2=1420312&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java Tue
Dec 11 18:04:24 2012
@@ -29,6 +29,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Properties;
 import java.util.Random;
 import java.util.TimerTask;
 
@@ -277,12 +278,17 @@ public class MiniAccumuloCluster {
     
     zooCfgFile = new File(confDir, "zoo.cfg");
     fileWriter = new FileWriter(zooCfgFile);
-    fileWriter.append("tickTime=1000\n");
-    fileWriter.append("initLimit=10\n");
-    fileWriter.append("syncLimit=5\n");
-    fileWriter.append("clientPort=" + zooKeeperPort + "\n");
-    fileWriter.append("maxClientCnxns=100\n");
-    fileWriter.append("dataDir=" + zooKeeperDir.getAbsolutePath() + "\n");
+    
+    // zookeeper uses Properties to read its config, so use that to write inorder to properly
escape things like Windows paths
+    Properties zooCfg = new Properties();
+    zooCfg.setProperty("tickTime", "1000");
+    zooCfg.setProperty("initLimit", "10");
+    zooCfg.setProperty("syncLimit", "5");
+    zooCfg.setProperty("clientPort", zooKeeperPort + "");
+    zooCfg.setProperty("maxClientCnxns", "100");
+    zooCfg.setProperty("dataDir", zooKeeperDir.getAbsolutePath());
+    zooCfg.store(fileWriter, null);
+
     fileWriter.close();
     
   }



Mime
View raw message