public final class KeepOnlyLastCommitDeletionPolicy extends 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()
Sole constructor.
|
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 KeepOnlyLastCommitDeletionPolicy()
public void onInit(List<? extends IndexCommit> commits)
onInit
in class IndexDeletionPolicy
commits
- List of current
point-in-time commits
,
sorted by age (the 0th one is the oldest commit).
Note that for a new index this method is invoked with
an empty list.public void onCommit(List<? extends IndexCommit> commits)
onCommit
in class IndexDeletionPolicy
commits
- List of IndexCommit
,
sorted by age (the 0th one is the oldest commit).Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.