long startTime = System.currentTimeMillis();
for (MapIV.Entry<PostingsAccumulator> e : partialPostings.entrySet()) {
// Emit a partial posting list for each term.
TERM.set(e.getKey());
context.setStatus("t" + TERM.get());
PostingsAccumulator pl = e.getValue();
postingsList.clear();
postingsList.setCollectionDocumentCount(collectionDocumentCount);
postingsList.setNumberOfPostings(pl.size());
int[] docnos = pl.getDocnos();
int[][] positions = pl.getPositions();
QuickSort.quicksortWithStack(positions, docnos, 0, pl.size() - 1);
for (int i = 0; i < pl.size(); i++) {
tp.set(positions[i], (short) positions[i].length);
postingsList.add(docnos[i], tp.getTf(), tp);
}
context.write(TERM, postingsList);
}