public void onCommit(List commits) throws IOException { int size = commits.size(); assert (size > keepAllFromInit); // keep all from init and the latest, delete the rest for (int i = keepAllFromInit; i < size - 1; i++) { ((IndexCommitPoint) commits.get(i)).delete(); } }