From 5b8e1c26d702e42b606265860c5e475970876aa5 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Fri, 17 Jun 2016 23:29:57 -0700 Subject: [PATCH] HDFS-10541. Diskbalancer: When no actions in plan, error message says "Plan was generated more than 24 hours ago". Contributed by Anu Engineer. --- .../hadoop/hdfs/server/diskbalancer/command/PlanCommand.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/PlanCommand.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/PlanCommand.java index 76bdc9fa93c..c13399ba9f1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/PlanCommand.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/PlanCommand.java @@ -140,7 +140,7 @@ public class PlanCommand extends Command { .getBytes(StandardCharsets.UTF_8)); } - if (plan != null) { + if (plan != null && plan.getVolumeSetPlans().size() > 0) { LOG.info("Writing plan to : {}", getOutputPath()); try (FSDataOutputStream planStream = create(String.format( DiskBalancer.PLAN_TEMPLATE,