private DocMap[] buildDocMaps(List<CodecReader> readers, Sort indexSort) throws IOException { if (indexSort == null) { // no index sort ... we only must map around deletions, and rebase to the merged segment's docID space return buildDeletionDocMaps(readers); } else { // do a merge sort of the incoming leaves: long t0 = System.nanoTime(); DocMap[] result = MultiSorter.sort(indexSort, readers); if (result == null) { // already sorted so we can switch back to map around deletions return buildDeletionDocMaps(readers); } else { needsIndexSort = true; } long t1 = System.nanoTime(); if (infoStream.isEnabled("SM")) { infoStream.message("SM", String.format(Locale.ROOT, "%.2f msec to build merge sorted DocMaps", (t1-t0)/1000000.0)); } return result; } }
private DocMap[] buildDocMaps(List<CodecReader> readers, Sort indexSort) throws IOException { if (indexSort == null) { // no index sort ... we only must map around deletions, and rebase to the merged segment's docID space return buildDeletionDocMaps(readers); } else { // do a merge sort of the incoming leaves: long t0 = System.nanoTime(); DocMap[] result = MultiSorter.sort(indexSort, readers); if (result == null) { // already sorted so we can switch back to map around deletions return buildDeletionDocMaps(readers); } else { needsIndexSort = true; } long t1 = System.nanoTime(); if (infoStream.isEnabled("SM")) { infoStream.message("SM", String.format(Locale.ROOT, "%.2f msec to build merge sorted DocMaps", (t1-t0)/1000000.0)); } return result; } }