ReturnCode rc = (numFailedContainers.get() == 0) ? ReturnCode.OK
: ReturnCode.CONTAINER_ERROR;
try {
if (numFailedContainers.get() == 0) {
rmHandler.finishApplication("Completed succesfully",
FinalApplicationStatus.SUCCEEDED);
} else {
String diag = "Completed with " + numFailedContainers.get()
+ " failed cotainers";
rmHandler.finishApplication(diag, FinalApplicationStatus.FAILED);