hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [2/3] hadoop git commit: HDFS-9421. NNThroughputBenchmark replication test NPE with -namenode option. Contributed by Mingliang Liu.
Date Mon, 03 Jul 2017 19:53:10 GMT
HDFS-9421. NNThroughputBenchmark replication test NPE with -namenode option. Contributed by
Mingliang Liu.

(cherry picked from commit a4f62a2d58d4e00cda3632411c6abda6eaa12a0e)


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

Branch: refs/heads/branch-2.7
Commit: 2af554821272a200f01bfb45e8817d994f604d36
Parents: 51f012a
Author: Xiaoyu Yao <xyao@apache.org>
Authored: Mon Nov 16 16:42:15 2015 -0800
Committer: Konstantin V Shvachko <shv@apache.org>
Committed: Mon Jul 3 11:42:59 2017 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt     |  3 +++
 .../server/namenode/NNThroughputBenchmark.java  | 26 +++++++++++++-------
 2 files changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2af55482/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 3b708f0..953e63a 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -108,6 +108,9 @@ Release 2.7.4 - UNRELEASED
     HDFS-7847. Modify NNThroughputBenchmark to be able to operate on a remote
     NameNode (Charles Lamb via Colin P. McCabe)
 
+    HDFS-9421. NNThroughputBenchmark replication test NPE with -namenode option.
+    (Mingliang Liu via xyao)
+
   OPTIMIZATIONS
 
     HDFS-10896. Move lock logging logic from FSNamesystem into FSNamesystemLock.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2af55482/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java
index 7f79fab..72e0eef 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java
@@ -106,9 +106,9 @@ import org.apache.log4j.LogManager;
  * By default the refresh is never called.</li>
  * <li>-keepResults do not clean up the name-space after execution.</li>
  * <li>-useExisting do not recreate the name-space, use existing data.</li>
- * <li>-namenode will run the test against a namenode in another
- * process or on another host. If you use this option, the namenode
- * must have dfs.namenode.fs-limits.min-block-size set to 16.</li>
+ * <li>-namenode will run the test (except {@link ReplicationStats}) against a
+ * namenode in another process or on another host. If you use this option,
+ * the namenode must have dfs.namenode.fs-limits.min-block-size set to 16.</li>
  * </ol>
  * 
  * The benchmark first generates inputs for each thread so that the
@@ -126,8 +126,9 @@ public class NNThroughputBenchmark implements Tool {
   private static final String GENERAL_OPTIONS_USAGE = 
     "     [-keepResults] | [-logLevel L] | [-UGCacheRefreshCount G] |" +
     " [-namenode <namenode URI>]\n" +
-    "     If using -namenode, set the namenode's" +
-    "         dfs.namenode.fs-limits.min-block-size to 16.";
+    "     If using -namenode, set the namenode's " +
+    "dfs.namenode.fs-limits.min-block-size to 16. Replication test does not " +
+        "support -namenode.";
 
   static Configuration config;
   static NameNode nameNode;
@@ -1504,13 +1505,22 @@ public class NNThroughputBenchmark implements Tool {
         ops.add(opStat);
       }
       if(runAll || ReplicationStats.OP_REPLICATION_NAME.equals(type)) {
-        opStat = new ReplicationStats(args);
-        ops.add(opStat);
+        if (namenodeUri != null || args.contains("-namenode")) {
+          LOG.warn("The replication test is ignored as it does not support " +
+              "standalone namenode in another process or on another host. " +
+              "Please run replication test without -namenode argument.");
+        } else {
+          opStat = new ReplicationStats(args);
+          ops.add(opStat);
+        }
       }
       if(runAll || CleanAllStats.OP_CLEAN_NAME.equals(type)) {
         opStat = new CleanAllStats(args);
         ops.add(opStat);
       }
+      if (ops.isEmpty()) {
+        printUsage();
+      }
 
       if (namenodeUri == null) {
         nameNode = NameNode.createNameNode(argv, config);
@@ -1534,8 +1544,6 @@ public class NNThroughputBenchmark implements Tool {
             DFSTestUtil.getRefreshUserMappingsProtocolProxy(config, nnUri);
         getBlockPoolId(dfs);
       }
-      if(ops.size() == 0)
-        printUsage();
       // run each benchmark
       for(OperationStatsBase op : ops) {
         LOG.info("Starting benchmark: " + op.getOpName());


---------------------------------------------------------------------
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