.newInstance(job.getOutputFormatClass(),
job.getConfiguration()).getClass()
.getName());
job.waitForCompletion(false);
if (job.isComplete()) {
Counters counters = job.getCounters();
totalRecordsOld = counters.findCounter(
MergeRecordCounter.TOTAL_RECORDS_OLD).getValue();
totalRecordsNew = counters.findCounter(
MergeRecordCounter.TOTAL_RECORDS_NEW).getValue();
badRecords = counters.findCounter(
MergeRecordCounter.BAD_RECORD).getValue();
output = counters.findCounter(MergeRecordCounter.OUTPUT)
.getValue();
logger.info("Total old records read are: " + totalRecordsOld);
logger.info("Total new records read are: " + totalRecordsNew);
logger.info("Bad Records are: " + badRecords);
logger.info("Output records are: " + output);