HDFS-9151. Mover should print the exit status/reason on console like balancer tool. (Contributed by Surendra singh lilhore)

This commit is contained in:
Vinayakumar B 2015-10-05 13:22:44 +05:30
parent 30e2f836a2
commit 0faa4efa3d
2 changed files with 14 additions and 0 deletions

View File

@ -1489,6 +1489,9 @@ Release 2.8.0 - UNRELEASED
HADOOP-11098. [JDK8] Max Non Heap Memory default changed between JDK7 HADOOP-11098. [JDK8] Max Non Heap Memory default changed between JDK7
and 8 (ozawa). 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 Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -592,12 +592,23 @@ static int run(Map<URI, List<Path>> namenodes, Configuration conf)
IOUtils.cleanup(LOG, nnc); IOUtils.cleanup(LOG, nnc);
iter.remove(); iter.remove();
} else if (r != ExitStatus.IN_PROGRESS) { } 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 // must be an error statue, return
return r.getExitCode(); return r.getExitCode();
} }
} }
Thread.sleep(sleeptime); Thread.sleep(sleeptime);
} }
System.out.println("Mover Successful: all blocks satisfy"
+ " the specified storage policy. Exiting...");
return ExitStatus.SUCCESS.getExitCode(); return ExitStatus.SUCCESS.getExitCode();
} finally { } finally {
for (NameNodeConnector nnc : connectors) { for (NameNodeConnector nnc : connectors) {