HDFS-14880. Correct the sequence of statistics & exit message in balencer. Contributed by Renukaprasad C.
This commit is contained in:
parent
c36014165c
commit
dcf55838ae
|
@ -626,7 +626,6 @@ public class Balancer {
|
||||||
final List<DatanodeStorageReport> reports = dispatcher.init();
|
final List<DatanodeStorageReport> reports = dispatcher.init();
|
||||||
final long bytesLeftToMove = init(reports);
|
final long bytesLeftToMove = init(reports);
|
||||||
if (bytesLeftToMove == 0) {
|
if (bytesLeftToMove == 0) {
|
||||||
System.out.println("The cluster is balanced. Exiting...");
|
|
||||||
return newResult(ExitStatus.SUCCESS, bytesLeftToMove, 0);
|
return newResult(ExitStatus.SUCCESS, bytesLeftToMove, 0);
|
||||||
} else {
|
} else {
|
||||||
LOG.info( "Need to move "+ StringUtils.byteDesc(bytesLeftToMove)
|
LOG.info( "Need to move "+ StringUtils.byteDesc(bytesLeftToMove)
|
||||||
|
@ -735,6 +734,9 @@ public class Balancer {
|
||||||
} else {
|
} else {
|
||||||
LOG.info("Skipping blockpool " + nnc.getBlockpoolID());
|
LOG.info("Skipping blockpool " + nnc.getBlockpoolID());
|
||||||
}
|
}
|
||||||
|
if (done) {
|
||||||
|
System.out.println("The cluster is balanced. Exiting...");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!done) {
|
if (!done) {
|
||||||
Thread.sleep(sleeptime);
|
Thread.sleep(sleeptime);
|
||||||
|
|
Loading…
Reference in New Issue