Преглед изворни кода

HADOOP-3044. NNBench sets the right configuration for the mapper. Contributed by Hairong.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@644966 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang пре 17 година
родитељ
комит
160265b747
2 измењених фајлова са 12 додато и 11 уклоњено
  1. 3 0
      CHANGES.txt
  2. 9 11
      src/test/org/apache/hadoop/dfs/NNBench.java

+ 3 - 0
CHANGES.txt

@@ -505,6 +505,9 @@ Trunk (unreleased changes)
     HADOOP-3050. DataNode sends one and only one block report after
     it registers with the namenode. (Hairong Kuang)
 
+    HADOOP-3044. NNBench sets the right configuration for the mapper.
+    (Hairong Kuang)
+
 Release 0.16.3 - Unreleased
 
   BUG FIXES

+ 9 - 11
src/test/org/apache/hadoop/dfs/NNBench.java

@@ -613,10 +613,16 @@ public class NNBench {
      * Constructor
      */
     public NNBenchMapper() {
-      super(config);
+    }
+    
+    /**
+     * Mapper base implementation
+     */
+    public void configure(JobConf conf) {
+      setConf(conf);
       
       try {
-        filesystem = FileSystem.get(config);
+        filesystem = FileSystem.get(conf);
       } catch(Exception e) {
         throw new RuntimeException("Cannot get file system.", e);
       }
@@ -628,13 +634,6 @@ public class NNBench {
       }
     }
     
-    /**
-     * Mapper base implementation
-     */
-    public void configure(JobConf conf) {
-      setConf(conf);
-    }
-    
     /**
      * Mapper base implementation
      */
@@ -648,8 +647,7 @@ public class NNBench {
     * synchronized nodes, to start at roughly the same time.
     */
     private boolean barrier() {
-      Configuration conf = filesystem.getConf();
-      long startTime = conf.getLong("test.nnbench.starttime", 0l);
+      long startTime = getConf().getLong("test.nnbench.starttime", 0l);
       long currentTime = System.currentTimeMillis();
       long sleepTime = startTime - currentTime;
       boolean retVal = false;