Counters counters = job.getCounters();
// Write out number of postings. NOTE: this value is not the same as
// number of postings, because postings for non-English terms are
// discarded, or as result of df cut.
env.writeCollectionTermCount((int) counters.findCounter(Statistics.Terms).getValue());
env.writeCollectionLength(counters.findCounter(Statistics.SumOfDocLengths).getValue());
return 0;
}
}