Class PersistentSnapshotDeletionPolicy
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(Int64) method to release commits from a previous snapshot's Generation.
@lucene.experimental
Inheritance
Inherited Members
Assembly: DistributedLucene.Net.dll
Syntax
public class PersistentSnapshotDeletionPolicy : SnapshotDeletionPolicy
Constructors
Name | Description |
---|---|
PersistentSnapshotDeletionPolicy(IndexDeletionPolicy, Directory) | PersistentSnapshotDeletionPolicy wraps another IndexDeletionPolicy to enable flexible snapshotting, passing CREATE_OR_APPEND by default. |
PersistentSnapshotDeletionPolicy(IndexDeletionPolicy, Directory, OpenMode) | PersistentSnapshotDeletionPolicy wraps another IndexDeletionPolicy to enable flexible snapshotting. |
Fields
Name | Description |
---|---|
SNAPSHOTS_PREFIX | Prefix used for the save file. |
Properties
Name | Description |
---|---|
LastSaveFile | Returns the file name the snapshots are currently
saved to, or |
Methods
Name | Description |
---|---|
Release(IndexCommit) | Deletes a snapshotted commit. Once this method returns, the snapshot information is persisted in the directory. |
Release(Int64) | Deletes a snapshotted commit by generation. Once this method returns, the snapshot information is persisted in the directory. |
Snapshot() | Snapshots the last commit. Once this method returns, the snapshot information is persisted in the directory. |