SnapshotDeletionPolicy
An IndexDeletionPolicy that wraps any other IndexDeletionPolicy and adds the ability to hold and later release snapshots of an index. While a snapshot is held, the [ ] will not remove any files associated with it even if the index is otherwise being actively, arbitrarily changed. Because we wrap another arbitrary IndexDeletionPolicy, this gives you the freedom to continue using whatever IndexDeletionPolicy you would normally want to use with your index.
This class maintains all snapshots in-memory, and so the information is not persisted and not protected against system failures. If persistence is important, you can use [ ].
Inheritors
Functions
Retrieve an IndexCommit from its generation; returns null if this IndexCommit is not currently snapshotted
Returns the total number of snapshots currently held.
Returns all IndexCommits held by at least one snapshot.
This is called each time the writer completed a commit. This gives the policy a chance to remove old commit points with each commit.
This is called once when a writer is first instantiated to give the policy a chance to remove old commit points.
Release a snapshotted commit.
Snapshots the last commit and returns it. Once a commit is 'snapshotted,' it is protected from deletion (as long as this IndexDeletionPolicy is used). The snapshot can be removed by calling .release followed by a call to .