private boolean waitFinish() { PerfConf conf = PerfConf.get(); while (true) { try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); return false; } String info = mSlaveStatus.getFinishStatus(conf.STATUS_DEBUG); System.out.println(info); LOG.info(info); int state = mSlaveStatus.finished(conf.FAILED_THEN_ABORT, conf.FAILED_PERCENTAGE); if (state == -1) { System.err.println("Enough slaves failed. Abort all the slaves."); LOG.error("Enough slaves failed. Abort all the slaves."); return true; } if (state == 1) { return true; } } }