Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9249018D85 for ; Tue, 17 Nov 2015 00:46:30 +0000 (UTC) Received: (qmail 90374 invoked by uid 500); 17 Nov 2015 00:46:30 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 90300 invoked by uid 500); 17 Nov 2015 00:46:30 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 90290 invoked by uid 99); 17 Nov 2015 00:46:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2015 00:46:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2D347E098F; Tue, 17 Nov 2015 00:46:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: xyao@apache.org To: common-commits@hadoop.apache.org Message-Id: <589c3e2845a346459ad6e1d74edcc1a9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HDFS-9421. NNThroughputBenchmark replication test NPE with -namenode option. Contributed by Mingliang Liu. Date: Tue, 17 Nov 2015 00:46:30 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/branch-2 5ea3f03ec -> dceed6b0a 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/dceed6b0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/dceed6b0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/dceed6b0 Branch: refs/heads/branch-2 Commit: dceed6b0a8921e800b81a951937e00b785f6c4ce Parents: 5ea3f03 Author: Xiaoyu Yao Authored: Mon Nov 16 16:42:15 2015 -0800 Committer: Xiaoyu Yao Committed: Mon Nov 16 16:42:57 2015 -0800 ---------------------------------------------------------------------- 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/dceed6b0/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 b962aca..daa3c95 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1456,6 +1456,9 @@ Release 2.8.0 - UNRELEASED HDFS-9387. Fix namenodeUri parameter parsing in NNThroughputBenchmark. (Mingliang Liu via xyao) + HDFS-9421. NNThroughputBenchmark replication test NPE with -namenode option. + (Mingliang Liu via xyao) + Release 2.7.3 - UNRELEASED INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/dceed6b0/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 5410877..affbe2f 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. *
  • -keepResults do not clean up the name-space after execution.
  • *
  • -useExisting do not recreate the name-space, use existing data.
  • - *
  • -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.
  • + *
  • -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.
  • * * * 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 ]\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; @@ -1471,13 +1472,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); @@ -1501,8 +1511,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());