tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bi...@apache.org
Subject git commit: TEZ-773. Fix configuration of tez jars location in MiniTezCluster (bikas)
Date Fri, 07 Feb 2014 19:42:44 GMT
Updated Branches:
  refs/heads/master 14127af12 -> b2139fe16


TEZ-773. Fix configuration of tez jars location in MiniTezCluster (bikas)


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

Branch: refs/heads/master
Commit: b2139fe16089e4c86412ed9458f75e71279c05f2
Parents: 14127af
Author: Bikas Saha <bikas@apache.org>
Authored: Fri Feb 7 11:42:14 2014 -0800
Committer: Bikas Saha <bikas@apache.org>
Committed: Fri Feb 7 11:42:14 2014 -0800

----------------------------------------------------------------------
 .../org/apache/tez/test/MiniTezCluster.java     |  4 ++--
 .../org/apache/tez/test/TestFaultTolerance.java | 20 +++++++++++++++-----
 2 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/b2139fe1/tez-tests/src/test/java/org/apache/tez/test/MiniTezCluster.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/test/java/org/apache/tez/test/MiniTezCluster.java b/tez-tests/src/test/java/org/apache/tez/test/MiniTezCluster.java
index e6cb9dc..62553a4 100644
--- a/tez-tests/src/test/java/org/apache/tez/test/MiniTezCluster.java
+++ b/tez-tests/src/test/java/org/apache/tez/test/MiniTezCluster.java
@@ -98,10 +98,10 @@ public class MiniTezCluster extends MiniYARNCluster {
     FileSystem fs = FileSystem.get(conf);
     Path testRootDir = fs.makeQualified(new Path("target", getName() + "-tmpDir"));
     Path appRemoteJar = new Path(testRootDir, "TezAppJar.jar");
-    // Copy AppJar and make it private.
+    // Copy AppJar and make it public.
     Path appMasterJar = new Path(MiniTezCluster.APPJAR);
     fs.copyFromLocalFile(appMasterJar, appRemoteJar);
-    fs.setPermission(appRemoteJar, new FsPermission("744"));
+    fs.setPermission(appRemoteJar, new FsPermission("777"));
 
     conf.set(TezConfiguration.TEZ_LIB_URIS, appRemoteJar.toUri().toString());
     LOG.info("Set TEZ-LIB-URI to: " + conf.get(TezConfiguration.TEZ_LIB_URIS));

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/b2139fe1/tez-tests/src/test/java/org/apache/tez/test/TestFaultTolerance.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/test/java/org/apache/tez/test/TestFaultTolerance.java b/tez-tests/src/test/java/org/apache/tez/test/TestFaultTolerance.java
index 63c3dd9..9569f6e 100644
--- a/tez-tests/src/test/java/org/apache/tez/test/TestFaultTolerance.java
+++ b/tez-tests/src/test/java/org/apache/tez/test/TestFaultTolerance.java
@@ -18,6 +18,7 @@
 
 package org.apache.tez.test;
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.Random;
 
@@ -26,7 +27,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.RawLocalFileSystem;
+import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.yarn.api.records.LocalResource;
 import org.apache.tez.client.AMConfiguration;
 import org.apache.tez.client.TezClientUtils;
@@ -57,20 +58,28 @@ public class TestFaultTolerance {
 
   private static Configuration conf = new Configuration();
   private static MiniTezCluster miniTezCluster;
-  private static FileSystem remoteFs;
   private static String TEST_ROOT_DIR = "target" + Path.SEPARATOR
       + TestFaultTolerance.class.getName() + "-tmpDir";
+  protected static MiniDFSCluster dfsCluster;
   
   private static TezSession tezSession = null;
   
   @BeforeClass
   public static void setup() throws Exception {
     LOG.info("Starting mini clusters");
+    FileSystem remoteFs = null;
+    try {
+      conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, TEST_ROOT_DIR);
+      dfsCluster = new MiniDFSCluster.Builder(conf).numDataNodes(1)
+          .format(true).racks(null).build();
+      remoteFs = dfsCluster.getFileSystem();
+    } catch (IOException io) {
+      throw new RuntimeException("problem starting mini dfs cluster", io);
+    }
     if (miniTezCluster == null) {
       miniTezCluster = new MiniTezCluster(TestFaultTolerance.class.getName(),
           4, 1, 1);
       Configuration miniTezconf = new Configuration(conf);
-      remoteFs = new RawLocalFileSystem();
       miniTezconf.set("fs.defaultFS", remoteFs.getUri().toString()); // use HDFS
       miniTezCluster.init(miniTezconf);
       miniTezCluster.start();
@@ -103,8 +112,9 @@ public class TestFaultTolerance {
       miniTezCluster.stop();
       miniTezCluster = null;
     }
-    if (remoteFs != null) {
-      remoteFs.close();
+    if (dfsCluster != null) {
+      dfsCluster.shutdown();
+      dfsCluster = null;
     }
   }
   


Mime
View raw message