HDFS-9151. Mover should print the exit status/reason on console like balancer tool. (Contributed by Surendra singh lilhore)
(cherry picked from commit 0faa4efa3dd74de9cc39584bf6e88cfbf3e9a045) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/dc72ed72 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/dc72ed72 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/dc72ed72 Branch: refs/heads/branch-2 Commit: dc72ed7218b47001c34af898157c8538ffb0caec Parents: e6514c6 Author: Vinayakumar B <[email protected]> Authored: Mon Oct 5 13:22:44 2015 +0530 Committer: Vinayakumar B <[email protected]> Committed: Mon Oct 5 13:23:30 2015 +0530 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/server/mover/Mover.java | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/dc72ed72/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 3484c7a..06dac2f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1145,6 +1145,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 http://git-wip-us.apache.org/repos/asf/hadoop/blob/dc72ed72/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java ---------------------------------------------------------------------- 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 afacebb..374ad5e 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 @@ -571,12 +571,23 @@ public class Mover { 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) { @@ -781,4 +792,4 @@ public class Mover { System.exit(-1); } } -} \ No newline at end of file +}
