hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject hadoop git commit: MAPREDUCE-6729. Accurately compute the test execute time in DFSIO. Contributed by mingleizhang.
Date Sat, 30 Jul 2016 13:16:25 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 f5bc6dd47 -> 96d5607e7


MAPREDUCE-6729. Accurately compute the test execute time in DFSIO. Contributed by mingleizhang.

This closes #112

(cherry picked from commit ce93595d7a18bd0561ae2c1983b51f6aba887179)


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

Branch: refs/heads/branch-2
Commit: 96d5607e7a2e6deebdb76858955127d09c125729
Parents: f5bc6dd
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Sat Jul 30 22:13:19 2016 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Sat Jul 30 22:16:13 2016 +0900

----------------------------------------------------------------------
 .../java/org/apache/hadoop/fs/TestDFSIO.java    | 54 ++++++++++----------
 1 file changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/96d5607e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
index 30a3587..154ec85 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
@@ -230,57 +230,45 @@ public class TestDFSIO implements Tool {
 
   public static void testWrite() throws Exception {
     FileSystem fs = cluster.getFileSystem();
-    long tStart = System.currentTimeMillis();
-    bench.writeTest(fs);
-    long execTime = System.currentTimeMillis() - tStart;
+    long execTime = bench.writeTest(fs);
     bench.analyzeResult(fs, TestType.TEST_TYPE_WRITE, execTime);
   }
 
   @Test (timeout = 10000)
   public void testRead() throws Exception {
     FileSystem fs = cluster.getFileSystem();
-    long tStart = System.currentTimeMillis();
-    bench.readTest(fs);
-    long execTime = System.currentTimeMillis() - tStart;
+    long execTime = bench.readTest(fs);
     bench.analyzeResult(fs, TestType.TEST_TYPE_READ, execTime);
   }
 
   @Test (timeout = 10000)
   public void testReadRandom() throws Exception {
     FileSystem fs = cluster.getFileSystem();
-    long tStart = System.currentTimeMillis();
     bench.getConf().setLong("test.io.skip.size", 0);
-    bench.randomReadTest(fs);
-    long execTime = System.currentTimeMillis() - tStart;
+    long execTime = bench.randomReadTest(fs);
     bench.analyzeResult(fs, TestType.TEST_TYPE_READ_RANDOM, execTime);
   }
 
   @Test (timeout = 10000)
   public void testReadBackward() throws Exception {
     FileSystem fs = cluster.getFileSystem();
-    long tStart = System.currentTimeMillis();
     bench.getConf().setLong("test.io.skip.size", -DEFAULT_BUFFER_SIZE);
-    bench.randomReadTest(fs);
-    long execTime = System.currentTimeMillis() - tStart;
+    long execTime = bench.randomReadTest(fs);
     bench.analyzeResult(fs, TestType.TEST_TYPE_READ_BACKWARD, execTime);
   }
 
   @Test (timeout = 10000)
   public void testReadSkip() throws Exception {
     FileSystem fs = cluster.getFileSystem();
-    long tStart = System.currentTimeMillis();
     bench.getConf().setLong("test.io.skip.size", 1);
-    bench.randomReadTest(fs);
-    long execTime = System.currentTimeMillis() - tStart;
+    long execTime = bench.randomReadTest(fs);
     bench.analyzeResult(fs, TestType.TEST_TYPE_READ_SKIP, execTime);
   }
 
   @Test (timeout = 10000)
   public void testAppend() throws Exception {
     FileSystem fs = cluster.getFileSystem();
-    long tStart = System.currentTimeMillis();
-    bench.appendTest(fs);
-    long execTime = System.currentTimeMillis() - tStart;
+    long execTime = bench.appendTest(fs);
     bench.analyzeResult(fs, TestType.TEST_TYPE_APPEND, execTime);
   }
 
@@ -288,9 +276,7 @@ public class TestDFSIO implements Tool {
   public void testTruncate() throws Exception {
     FileSystem fs = cluster.getFileSystem();
     bench.createControlFile(fs, DEFAULT_NR_BYTES / 2, DEFAULT_NR_FILES);
-    long tStart = System.currentTimeMillis();
-    bench.truncateTest(fs);
-    long execTime = System.currentTimeMillis() - tStart;
+    long execTime = bench.truncateTest(fs);
     bench.analyzeResult(fs, TestType.TEST_TYPE_TRUNCATE, execTime);
   }
 
@@ -432,12 +418,14 @@ public class TestDFSIO implements Tool {
     }
   }
 
-  private void writeTest(FileSystem fs) throws IOException {
+  private long writeTest(FileSystem fs) throws IOException {
     Path writeDir = getWriteDir(config);
     fs.delete(getDataDir(config), true);
     fs.delete(writeDir, true);
-    
+    long tStart = System.currentTimeMillis();
     runIOTest(WriteMapper.class, writeDir);
+    long execTime = System.currentTimeMillis() - tStart;
+    return execTime;
   }
   
   private void runIOTest(
@@ -498,10 +486,13 @@ public class TestDFSIO implements Tool {
     }
   }
 
-  private void appendTest(FileSystem fs) throws IOException {
+  private long appendTest(FileSystem fs) throws IOException {
     Path appendDir = getAppendDir(config);
     fs.delete(appendDir, true);
+    long tStart = System.currentTimeMillis();
     runIOTest(AppendMapper.class, appendDir);
+    long execTime = System.currentTimeMillis() - tStart;
+    return execTime;
   }
 
   /**
@@ -541,10 +532,13 @@ public class TestDFSIO implements Tool {
     }
   }
 
-  private void readTest(FileSystem fs) throws IOException {
+  private long readTest(FileSystem fs) throws IOException {
     Path readDir = getReadDir(config);
     fs.delete(readDir, true);
+    long tStart = System.currentTimeMillis();
     runIOTest(ReadMapper.class, readDir);
+    long execTime = System.currentTimeMillis() - tStart;
+    return execTime;
   }
 
   /**
@@ -622,10 +616,13 @@ public class TestDFSIO implements Tool {
     }
   }
 
-  private void randomReadTest(FileSystem fs) throws IOException {
+  private long randomReadTest(FileSystem fs) throws IOException {
     Path readDir = getRandomReadDir(config);
     fs.delete(readDir, true);
+    long tStart = System.currentTimeMillis();
     runIOTest(RandomReadMapper.class, readDir);
+    long execTime = System.currentTimeMillis() - tStart;
+    return execTime;
   }
 
   /**
@@ -667,10 +664,13 @@ public class TestDFSIO implements Tool {
     }
   }
 
-  private void truncateTest(FileSystem fs) throws IOException {
+  private long truncateTest(FileSystem fs) throws IOException {
     Path TruncateDir = getTruncateDir(config);
     fs.delete(TruncateDir, true);
+    long tStart = System.currentTimeMillis();
     runIOTest(TruncateMapper.class, TruncateDir);
+    long execTime = System.currentTimeMillis() - tStart;
+    return execTime;
   }
 
   private void sequentialTest(FileSystem fs, 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message