You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2012/07/26 17:12:24 UTC

svn commit: r1366034 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java

Author: tedyu
Date: Thu Jul 26 15:12:23 2012
New Revision: 1366034

URL: http://svn.apache.org/viewvc?rev=1366034&view=rev
Log:
HBASE-6455 org.apache.hadoop.hbase.PerformanceEvaluation sets the map reduce output path as a child of input path (Aditya)


Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java?rev=1366034&r1=1366033&r2=1366034&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java Thu Jul 26 15:12:23 2012
@@ -316,6 +316,9 @@ public class PerformanceEvaluation {
       List<InputSplit> splitList = new ArrayList<InputSplit>();
 
       for (FileStatus file: listStatus(job)) {
+        if (file.isDir()) {
+          continue;
+        }
         Path path = file.getPath();
         FileSystem fs = path.getFileSystem(job.getConfiguration());
         FSDataInputStream fileIn = fs.open(path);
@@ -644,7 +647,7 @@ public class PerformanceEvaluation {
     job.setNumReduceTasks(1);
 
     job.setOutputFormatClass(TextOutputFormat.class);
-    TextOutputFormat.setOutputPath(job, new Path(inputDir,"outputs"));
+    TextOutputFormat.setOutputPath(job, new Path(inputDir.getParent(), "outputs"));
 
     TableMapReduceUtil.addDependencyJars(job);
     // Add a Class from the hbase.jar so it gets registered too.
@@ -663,14 +666,14 @@ public class PerformanceEvaluation {
    * @throws IOException
    */
   private Path writeInputFile(final Configuration c) throws IOException {
-    FileSystem fs = FileSystem.get(c);
-    if (!fs.exists(PERF_EVAL_DIR)) {
-      fs.mkdirs(PERF_EVAL_DIR);
-    }
     SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
-    Path subdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
-    fs.mkdirs(subdir);
-    Path inputFile = new Path(subdir, "input.txt");
+    Path jobdir = new Path(PERF_EVAL_DIR, formatter.format(new Date()));
+    Path inputDir = new Path(jobdir, "inputs");
+
+    FileSystem fs = FileSystem.get(c);
+    fs.mkdirs(inputDir);
+
+    Path inputFile = new Path(inputDir, "input.txt");
     PrintStream out = new PrintStream(fs.create(inputFile));
     // Make input random.
     Map<Integer, String> m = new TreeMap<Integer, String>();
@@ -695,7 +698,7 @@ public class PerformanceEvaluation {
     } finally {
       out.close();
     }
-    return subdir;
+    return inputDir;
   }
 
   /**