private static class ReportingMergeScheduler extends MergeScheduler {
@Override
public void merge(IndexWriter writer, MergeTrigger trigger, boolean newMergesFound) throws IOException {
OneMerge merge = null;
while ((merge = writer.getNextMerge()) != null) {
if (VERBOSE) {
System.out.println("executing merge " + merge.segString(writer.getDirectory()));
}
writer.merge(merge);
}
}