From 47dcb0f95288a5e6f05480d274f1ebd8cc873ef8 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Tue, 7 Jun 2016 10:18:05 -0700 Subject: [PATCH] HDFS-10476. DiskBalancer: Plan command output directory should be a sub-directory. Contributed by Anu Engineer. --- .../hadoop/hdfs/server/diskbalancer/command/Command.java | 4 ++-- .../main/java/org/apache/hadoop/hdfs/tools/DiskBalancer.java | 4 ++++ 2 files changed, 6 insertions(+), 2 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 feee977fc9..fb975a88a9 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 @@ -163,10 +163,10 @@ protected void setOutputPath(String path) throws IOException { if (getClusterURI().getScheme().startsWith("file")) { diskBalancerLogs = new Path( System.getProperty("user.dir") + DEFAULT_LOG_DIR.toString() + - format.format(now)); + Path.SEPARATOR + format.format(now)); } else { diskBalancerLogs = new Path(DEFAULT_LOG_DIR.toString() + - format.format(now)); + Path.SEPARATOR + format.format(now)); } } else { diskBalancerLogs = new Path(path); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DiskBalancer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DiskBalancer.java index 4005652929..dde2ce465e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DiskBalancer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DiskBalancer.java @@ -216,6 +216,10 @@ private void addPlanCommands(Options opt) { Option help = new Option(HELP, true, "Help about a command or this message"); opt.addOption(help); + + Option verbose = new Option(VERBOSE, "Print out the summary of the plan"); + opt.addOption(verbose); + } /**