From d2ff793ae4788418116b64e7141e80897d4f9c24 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Tue, 7 Jun 2016 15:10:22 -0700 Subject: [PATCH] HDFS-10496. DiskBalancer: ExecuteCommand checks planFile in a wrong way. Contributed by Lei (Eddy) Xu. --- .../hadoop/hdfs/server/diskbalancer/command/ExecuteCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/ExecuteCommand.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/ExecuteCommand.java index c17ef00631d..6d30e86cdbd 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/ExecuteCommand.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/ExecuteCommand.java @@ -61,7 +61,7 @@ public class ExecuteCommand extends Command { verifyCommandOptions(DiskBalancer.EXECUTE, cmd); String planFile = cmd.getOptionValue(DiskBalancer.EXECUTE); - Preconditions.checkArgument(planFile == null || planFile.isEmpty(), + Preconditions.checkArgument(planFile != null && !planFile.isEmpty(), "Invalid plan file specified."); String planData = null;