Package org.apache.lucene.index
Class KeepOnlyLastCommitDeletionPolicy
- java.lang.Object
-
- org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy
-
- All Implemented Interfaces:
IndexDeletionPolicy
public final class KeepOnlyLastCommitDeletionPolicy extends Object implements IndexDeletionPolicy
ThisIndexDeletionPolicy
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.
-
-
Constructor Summary
Constructors Constructor Description KeepOnlyLastCommitDeletionPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onCommit(List<? extends IndexCommit> commits)
Deletes all commits except the most recent one.void
onInit(List<? extends IndexCommit> commits)
Deletes all commits except the most recent one.
-
-
-
Method Detail
-
onInit
public void onInit(List<? extends IndexCommit> commits)
Deletes all commits except the most recent one.- Specified by:
onInit
in interfaceIndexDeletionPolicy
- Parameters:
commits
- List of currentpoint-in-time commits
, sorted by age (the 0th one is the oldest commit).
-
onCommit
public void onCommit(List<? extends IndexCommit> commits)
Deletes all commits except the most recent one.- Specified by:
onCommit
in interfaceIndexDeletionPolicy
- Parameters:
commits
- List ofIndexCommit
, sorted by age (the 0th one is the oldest commit).
-
-