org.elasticsearch.index.deletionpolicy
Class KeepOnlyLastDeletionPolicy
java.lang.Object
org.elasticsearch.index.shard.AbstractIndexShardComponent
org.elasticsearch.index.deletionpolicy.KeepOnlyLastDeletionPolicy
- All Implemented Interfaces:
- org.apache.lucene.index.IndexDeletionPolicy, IndexShardComponent
public class KeepOnlyLastDeletionPolicy
- extends AbstractIndexShardComponent
- implements org.apache.lucene.index.IndexDeletionPolicy
This 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.
Method Summary |
void |
onCommit(java.util.List<? extends org.apache.lucene.index.IndexCommit> commits)
Deletes all commits except the most recent one. |
void |
onInit(java.util.List<? extends org.apache.lucene.index.IndexCommit> commits)
Deletes all commits except the most recent one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KeepOnlyLastDeletionPolicy
@Inject
public KeepOnlyLastDeletionPolicy(ShardId shardId,
@IndexSettings
Settings indexSettings)
onInit
public void onInit(java.util.List<? extends org.apache.lucene.index.IndexCommit> commits)
- Deletes all commits except the most recent one.
- Specified by:
onInit
in interface org.apache.lucene.index.IndexDeletionPolicy
onCommit
public void onCommit(java.util.List<? extends org.apache.lucene.index.IndexCommit> commits)
- Deletes all commits except the most recent one.
- Specified by:
onCommit
in interface org.apache.lucene.index.IndexDeletionPolicy