public final class KeepOnlyLastCommitDeletionPolicy extends Object implements IndexDeletionPolicy
IndexDeletionPolicy
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 and Description |
---|
KeepOnlyLastCommitDeletionPolicy() |
Modifier and Type | Method and 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.
|
public void onInit(List<? extends IndexCommit> commits)
onInit
in interface IndexDeletionPolicy
commits
- List of current
point-in-time commits
,
sorted by age (the 0th one is the oldest commit).public void onCommit(List<? extends IndexCommit> commits)
onCommit
in interface IndexDeletionPolicy
commits
- List of IndexCommit
,
sorted by age (the 0th one is the oldest commit).