accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject accumulo git commit: ACCUMULO-4002 merge MiniDFS and user core-site.xml
Date Fri, 18 Sep 2015 19:48:09 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master a0c96e0ef -> fdcc1698c


ACCUMULO-4002 merge MiniDFS and user core-site.xml


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/fdcc1698
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/fdcc1698
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/fdcc1698

Branch: refs/heads/master
Commit: fdcc1698ca02867635e1bc2d72d5fa2d462b3d63
Parents: a0c96e0
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Fri Sep 18 11:41:58 2015 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Fri Sep 18 11:41:58 2015 -0400

----------------------------------------------------------------------
 .../accumulo/test/functional/ConfigurableMacBase.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/fdcc1698/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java
b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java
index b86fcfe..92424a8 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java
@@ -43,6 +43,7 @@ import org.apache.accumulo.minicluster.impl.ZooKeeperBindException;
 import org.apache.accumulo.test.util.CertUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
 import org.apache.zookeeper.KeeperException;
 import org.junit.After;
 import org.junit.Before;
@@ -138,12 +139,14 @@ public class ConfigurableMacBase extends AccumuloITBase {
     cluster = new MiniAccumuloClusterImpl(cfg);
     if (coreSite.size() > 0) {
       File csFile = new File(cluster.getConfig().getConfDir(), "core-site.xml");
-      if (csFile.exists())
-        throw new RuntimeException(csFile + " already exist");
-
-      OutputStream out = new BufferedOutputStream(new FileOutputStream(new File(cluster.getConfig().getConfDir(),
"core-site.xml")));
+      if (csFile.exists()) {
+        coreSite.addResource(new Path(csFile.getAbsolutePath()));
+      }
+      File tmp = new File(csFile.getAbsolutePath() + ".tmp");
+      OutputStream out = new BufferedOutputStream(new FileOutputStream(tmp));
       coreSite.writeXml(out);
       out.close();
+      tmp.renameTo(csFile);
     }
     beforeClusterStart(cfg);
   }


Mime
View raw message