| java.lang.Object org.apache.lucene.index.SnapshotDeletionPolicy
SnapshotDeletionPolicy | public class SnapshotDeletionPolicy implements IndexDeletionPolicy(Code) | | A
IndexDeletionPolicy that wraps around any other
IndexDeletionPolicy and adds the ability to hold and
later release a single "snapshot" of an index. While
the snapshot is held, the
IndexWriter will not
remove any files associated with it even if the index is
otherwise being actively, arbitrarily changed. Because
we wrap another arbitrary
IndexDeletionPolicy , this
gives you the freedom to continue using whatever
IndexDeletionPolicy you would normally want to use with your
index.
|
Method Summary | |
public synchronized void | onCommit(List commits) | public synchronized void | onInit(List commits) | public synchronized void | release() Release the currently held snapshot. | public synchronized IndexCommitPoint | snapshot() Take a snapshot of the most recent commit to the
index. |
release | public synchronized void release()(Code) | | Release the currently held snapshot.
|
snapshot | public synchronized IndexCommitPoint snapshot()(Code) | | Take a snapshot of the most recent commit to the
index. You must call release() to free this snapshot.
Note that while the snapshot is held, the files it
references will not be deleted, which will consume
additional disk space in your index. If you take a
snapshot at a particularly bad time (say just before
you call optimize()) then in the worst case this could
consume an extra 1X of your total index size, until
you release the snapshot.
|
|
|