From e8de28181a3ed0053d5cd5f196434739880ee978 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Wed, 22 Jun 2016 17:29:34 -0700 Subject: [PATCH] HDFS-10551. o.a.h.h.s.diskbalancer.command.Command does not actually verify options as expected. Contributed by Anu Engineer. --- .../server/diskbalancer/command/Command.java | 9 +- .../diskbalancer/command/ExecuteCommand.java | 1 - .../diskbalancer/command/HelpCommand.java | 1 + .../diskbalancer/command/PlanCommand.java | 1 + .../hadoop/hdfs/tools/DiskBalancer.java | 14 ++- .../src/main/resources/hdfs-default.xml | 40 +++++++ .../command/TestDiskBalancerCommand.java | 100 +++++++++++++++--- 7 files changed, 141 insertions(+), 25 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/Command.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/Command.java index 3ea1b03d1ae..de77365f565 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/Command.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/Command.java @@ -82,8 +82,6 @@ public abstract class Command extends Configured { public Command(Configuration conf) { super(conf); // These arguments are valid for all commands. - addValidCommandParameters(DiskBalancer.HELP, "Help for this command"); - addValidCommandParameters("arg", ""); topNodes = 0; } @@ -248,12 +246,13 @@ public abstract class Command extends Configured { Iterator