Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BBF1F200B38 for ; Fri, 24 Jun 2016 08:05:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BA855160A6A; Fri, 24 Jun 2016 06:05:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0D6EE160A59 for ; Fri, 24 Jun 2016 08:05:52 +0200 (CEST) Received: (qmail 48698 invoked by uid 500); 24 Jun 2016 06:05:38 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 40596 invoked by uid 99); 24 Jun 2016 06:05:33 -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; Fri, 24 Jun 2016 06:05:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F3170E3813; Fri, 24 Jun 2016 06:05:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: arp@apache.org To: common-commits@hadoop.apache.org Date: Fri, 24 Jun 2016 06:06:18 -0000 Message-Id: <30e0ce83e2674efe983b52207f175aa3@git.apache.org> In-Reply-To: <5fc8484880aa41e0adb1a5360d0899ef@git.apache.org> References: <5fc8484880aa41e0adb1a5360d0899ef@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [47/49] hadoop git commit: HDFS-10571. TestDiskBalancerCommand#testPlanNode failed with IllegalArgumentException. Contributed by Xiaobing Zhou. archived-at: Fri, 24 Jun 2016 06:05:53 -0000 HDFS-10571. TestDiskBalancerCommand#testPlanNode failed with IllegalArgumentException. Contributed by Xiaobing Zhou. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/b2584bee Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/b2584bee Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/b2584bee Branch: refs/heads/trunk Commit: b2584bee457192ea5789667c1317236f47fa6060 Parents: 8a6e354 Author: Anu Engineer Authored: Thu Jun 23 14:48:40 2016 -0700 Committer: Arpit Agarwal Committed: Thu Jun 23 18:27:02 2016 -0700 ---------------------------------------------------------------------- .../command/TestDiskBalancerCommand.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/b2584bee/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/diskbalancer/command/TestDiskBalancerCommand.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/diskbalancer/command/TestDiskBalancerCommand.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/diskbalancer/command/TestDiskBalancerCommand.java index b0821e2..e55c418 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/diskbalancer/command/TestDiskBalancerCommand.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/diskbalancer/command/TestDiskBalancerCommand.java @@ -280,7 +280,7 @@ public class TestDiskBalancerCommand { final String cmdLine = String .format( "hdfs diskbalancer %s", planArg); - runCommand(cmdLine); + runCommand(cmdLine, cluster); } /* Test that illegal arguments are handled correctly*/ @@ -335,12 +335,12 @@ public class TestDiskBalancerCommand { runCommand(cmdLine); } - private List runCommand(final String cmdLine) throws Exception { + private List runCommandInternal(final String cmdLine) throws + Exception { String[] cmds = StringUtils.split(cmdLine, ' '); org.apache.hadoop.hdfs.tools.DiskBalancer db = new org.apache.hadoop.hdfs.tools.DiskBalancer(conf); - FileSystem.setDefaultUri(conf, clusterJson); ByteArrayOutputStream bufOut = new ByteArrayOutputStream(); PrintStream out = new PrintStream(bufOut); db.run(cmds, out); @@ -353,6 +353,17 @@ public class TestDiskBalancerCommand { return outputs; } + private List runCommand(final String cmdLine) throws Exception { + FileSystem.setDefaultUri(conf, clusterJson); + return runCommandInternal(cmdLine); + } + + private List runCommand(final String cmdLine, + MiniDFSCluster miniCluster) throws Exception { + FileSystem.setDefaultUri(conf, miniCluster.getURI()); + return runCommandInternal(cmdLine); + } + /** * Making sure that we can query the node without having done a submit. * @throws Exception --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org