try {
// Now wait until its finished
long tryUntil = System.currentTimeMillis() + timeout;
while (System.currentTimeMillis() < tryUntil) {
Thread.sleep(100);
IndexerDefinition definition = model.getIndexer(INDEX_NAME);
if (definition.getBatchIndexingState() == IndexerDefinition.BatchIndexingState.INACTIVE) {
Long amountFailed = null;
//amountFailed = definition.getLastBatchBuildInfo().getCounters().get(COUNTER_NUM_FAILED_RECORDS);
boolean successFlag = definition.getLastBatchBuildInfo().isFinishedSuccessful();
indexSuccess = successFlag && (amountFailed == null || amountFailed == 0L);
if (!indexSuccess) {
fail("Batch index build did not finish successfully: success flag = " +
successFlag + ", amount failed records = " + amountFailed + ", job url = " +
definition.getLastBatchBuildInfo().getMapReduceJobTrackingUrls());
} else {
break;
}
}
}