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

(cherry picked from commit 0faa4efa3d)
This commit is contained in:
Vinayakumar B 2015-10-05 13:22:44 +05:30
parent e6514c6a3b
commit dc72ed7218
2 changed files with 15 additions and 1 deletions

View File

@ -1145,6 +1145,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

@ -571,12 +571,23 @@ public class Mover {
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) {
@ -781,4 +792,4 @@ public class Mover {
System.exit(-1); System.exit(-1);
} }
} }
} }