protected void waitBeforeIterationFinish(long loadFinish) { IndexStatsMBean indexStatsMBean = WhiteboardUtils.getService(whiteboard, IndexStatsMBean.class); if (indexStatsMBean != null) { String lastIndexedTime = indexStatsMBean.getLastIndexedTime(); while (((lastIndexedTime == null) || ISO8601.parse(lastIndexedTime).getTimeInMillis() < loadFinish)) { try { if (LOG.isDebugEnabled()) { LOG.debug("Waiting for async indexing to finish"); } Thread.sleep(5000); } catch (InterruptedException e) { LOG.error("Error waiting for async index to finish", e); } lastIndexedTime = indexStatsMBean.getLastIndexedTime(); } LOG.info("Execution Count {}", indexStatsMBean.getExecutionCount()); LOG.info("Execution Time {}", indexStatsMBean.getExecutionTime()); LOG.info("Consolidated Execution Stats {}", indexStatsMBean.getConsolidatedExecutionStats()); } }