Class PersistentSnapshotDeletionPolicy


public class PersistentSnapshotDeletionPolicy extends SnapshotDeletionPolicy
A SnapshotDeletionPolicy which adds a persistence layer so that snapshots can be maintained across the life of an application. The snapshots are persisted in a Directory and are committed as soon as snapshot() or release(IndexCommit) is called.

NOTE: Sharing PersistentSnapshotDeletionPolicys that write to the same directory across IndexWriters will corrupt snapshots. You should make sure every IndexWriter has its own PersistentSnapshotDeletionPolicy and that they all write to a different Directory. It is OK to use the same Directory that holds the index.

This class adds a release(long) method to release commits from a previous snapshot's IndexCommit.getGeneration().

WARNING: This API is experimental and might change in incompatible ways in the next release.