Class PersistentSnapshotDeletionPolicy

  • All Implemented Interfaces:
    IndexDeletionPolicy

    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(String) or release(String) is called.

    NOTE: this class receives a Directory to persist the data into a Lucene index. It is highly recommended to use a dedicated directory (and on stable storage as well) for persisting the snapshots' information, and not reuse the content index directory, or otherwise conflicts and index corruptions will occur.

    NOTE: you should call close() when you're done using this class for safetyness (it will close the IndexWriter instance used).