public final class KeepOnlyLastCommitDeletionPolicy extends Object implements IndexDeletionPolicy
This {@link IndexDeletionPolicy} implementation that
keeps only the most recent commit and immediately removes
all prior commits after a new commit is done. This is
the default deletion policy.
// Note that commits.size() should normally be 2 (if not
// called by onInit above):
int size = commits.size();
for(int i=0;i<size-1;i++) {
((IndexCommitPoint) commits.get(i)).delete();
}