Class KeepOnlyLastCommitDeletionPolicy

  • All Implemented Interfaces:
    java.lang.Cloneable

    public final class KeepOnlyLastCommitDeletionPolicy
    extends 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onCommit​(java.util.List<? extends IndexCommit> commits)
      Deletes all commits except the most recent one.
      void onInit​(java.util.List<? extends IndexCommit> commits)
      Deletes all commits except the most recent one.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeepOnlyLastCommitDeletionPolicy

        public KeepOnlyLastCommitDeletionPolicy()
        Sole constructor.
    • Method Detail

      • onInit

        public void onInit​(java.util.List<? extends IndexCommit> commits)
        Deletes all commits except the most recent one.
        Specified by:
        onInit in class IndexDeletionPolicy
        Parameters:
        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.
      • onCommit

        public void onCommit​(java.util.List<? extends IndexCommit> commits)
        Deletes all commits except the most recent one.
        Specified by:
        onCommit in class IndexDeletionPolicy
        Parameters:
        commits - List of IndexCommit, sorted by age (the 0th one is the oldest commit).