KeepOnlyLastCommitDeletionPolicy (Lucene 2.4.1 API)
Keywords: org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

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.

Constructor Summary
`KeepOnlyLastCommitDeletionPolicy()`

Method Summary
`void` | `onCommit(List commits)` Deletes all commits except the most recent one.
`void` | `onInit(List 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`

Constructor Detail

### KeepOnlyLastCommitDeletionPolicy

    public KeepOnlyLastCommitDeletionPolicy()

Method Detail

### onInit

    public void onInit(List commits)

  Deletes all commits except the most recent one.

  Specified by:
    `onInit` in interface `IndexDeletionPolicy`
  Parameters:
    `commits` - List of current `point-in-time commits`, sorted by age (the 0th one is the oldest commit).

### onCommit

    public void onCommit(List commits)

  Deletes all commits except the most recent one.

  Specified by:
    `onCommit` in interface `IndexDeletionPolicy`
  Parameters:
    `commits` - List of `IndexCommit`, sorted by age (the 0th one is the oldest commit).

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.