incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Fixing issue with the dfs minicluster startup.
Date Tue, 09 Dec 2014 14:00:47 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master 415daaeff -> a829afe61


Fixing issue with the dfs minicluster startup.


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

Branch: refs/heads/master
Commit: a829afe61cb1dc04fd23681b1fcb9a7f4b95b27b
Parents: 415daae
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Dec 9 09:00:51 2014 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Dec 9 09:00:51 2014 -0500

----------------------------------------------------------------------
 .../src/test/java/org/apache/blur/MiniCluster.java   | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a829afe6/blur-core/src/test/java/org/apache/blur/MiniCluster.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/MiniCluster.java b/blur-core/src/test/java/org/apache/blur/MiniCluster.java
index ff58ff3..7f3ee2c 100644
--- a/blur-core/src/test/java/org/apache/blur/MiniCluster.java
+++ b/blur-core/src/test/java/org/apache/blur/MiniCluster.java
@@ -266,8 +266,8 @@ public class MiniCluster {
 
   public void startControllers(BlurConfiguration configuration, int num, boolean randomPort)
{
     BlurConfiguration localConf = getBlurConfiguration(configuration);
-    if(randomPort) {
-    	localConf.setInt(BLUR_CONTROLLER_BIND_PORT, 0);
+    if (randomPort) {
+      localConf.setInt(BLUR_CONTROLLER_BIND_PORT, 0);
     }
     for (int i = 0; i < num; i++) {
       try {
@@ -288,8 +288,8 @@ public class MiniCluster {
 
   public void startShards(final BlurConfiguration configuration, int num, final boolean randomPort)
{
     final BlurConfiguration localConf = getBlurConfiguration(configuration);
-    if(randomPort) {
-    	localConf.setInt(BLUR_SHARD_BIND_PORT, 0);
+    if (randomPort) {
+      localConf.setInt(BLUR_SHARD_BIND_PORT, 0);
     }
     ExecutorService executorService = Executors.newFixedThreadPool(num);
     List<Future<ThriftServer>> futures = new ArrayList<Future<ThriftServer>>();
@@ -419,9 +419,14 @@ public class MiniCluster {
 
   public void startDfs(Configuration conf, boolean format, String path) {
     String perm;
-    Path p = new Path(new File("./target").getAbsolutePath());
+    Path p = new Path(new File(path).getAbsolutePath());
     try {
       FileSystem fileSystem = p.getFileSystem(conf);
+      if (!fileSystem.exists(p)) {
+        if (!fileSystem.mkdirs(p)) {
+          throw new RuntimeException("Could not create path [" + path + "]");
+        }
+      }
       FileStatus fileStatus = fileSystem.getFileStatus(p);
       FsPermission permission = fileStatus.getPermission();
       perm = permission.getUserAction().ordinal() + "" + permission.getGroupAction().ordinal()
+ ""


Mime
View raw message