diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index ec7e084889..bf4284a7dd 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1489,6 +1489,9 @@ Release 2.8.0 - UNRELEASED HADOOP-11098. [JDK8] Max Non Heap Memory default changed between JDK7 and 8 (ozawa). + HDFS-9151. Mover should print the exit status/reason on console like + balancer tool. (Surendra singh lilhore via vinayakumarb) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java index 1e07cad69b..d9ac0baa44 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java @@ -592,12 +592,23 @@ static int run(Map> namenodes, Configuration conf) IOUtils.cleanup(LOG, nnc); iter.remove(); } else if (r != ExitStatus.IN_PROGRESS) { + if (r == ExitStatus.NO_MOVE_PROGRESS) { + System.err.println("Failed to move some blocks after " + + m.retryMaxAttempts + " retries. Exiting..."); + } else if (r == ExitStatus.NO_MOVE_BLOCK) { + System.err.println("Some blocks can't be moved. Exiting..."); + } else { + System.err.println("Mover failed. Exiting with status " + r + + "... "); + } // must be an error statue, return return r.getExitCode(); } } Thread.sleep(sleeptime); } + System.out.println("Mover Successful: all blocks satisfy" + + " the specified storage policy. Exiting..."); return ExitStatus.SUCCESS.getExitCode(); } finally { for (NameNodeConnector nnc : connectors) {