public final class IndexDeletionPolicyWrapper extends IndexDeletionPolicy
clone() method returns this in order to make
this IndexDeletionPolicy instance trackable across IndexWriter
instantiations. This is correct because each core has its own
IndexDeletionPolicy and never has more than one open IndexWriter.IndexDeletionPolicy| Constructor and Description |
|---|
IndexDeletionPolicyWrapper(IndexDeletionPolicy deletionPolicy) |
| Modifier and Type | Method and Description |
|---|---|
IndexDeletionPolicy |
clone() |
IndexCommit |
getCommitPoint(Long gen) |
Map<Long,IndexCommit> |
getCommits()
Gets the commit points for the index.
|
static long |
getCommitTimestamp(IndexCommit commit) |
IndexCommit |
getLatestCommit()
Gets the most recent commit point
It is recommended to reserve a commit point for the duration of usage so that
it is not deleted by the underlying deletion policy
|
IndexDeletionPolicy |
getWrappedDeletionPolicy() |
void |
onCommit(List<? extends IndexCommit> list)
Internal use for Lucene...
|
void |
onInit(List<? extends IndexCommit> list)
Internal use for Lucene...
|
void |
releaseCommitPoint(Long indexCommitGen)
Release a previously saved commit point
|
void |
saveCommitPoint(Long indexCommitGen)
Permanently prevent this commit point from being deleted.
|
void |
setReserveDuration(Long indexGen,
long reserveTime)
Set the duration for which commit point is to be reserved by the deletion policy.
|
public IndexDeletionPolicyWrapper(IndexDeletionPolicy deletionPolicy)
public IndexCommit getLatestCommit()
public IndexDeletionPolicy getWrappedDeletionPolicy()
public void setReserveDuration(Long indexGen, long reserveTime)
indexGen - gen of the commit point to be reservedreserveTime - time in milliseconds for which the commit point is to be reservedpublic void saveCommitPoint(Long indexCommitGen)
public void releaseCommitPoint(Long indexCommitGen)
public void onInit(List<? extends IndexCommit> list) throws IOException
onInit in class IndexDeletionPolicyIOExceptionpublic void onCommit(List<? extends IndexCommit> list) throws IOException
onCommit in class IndexDeletionPolicyIOExceptionpublic IndexCommit getCommitPoint(Long gen)
gen - the gen of the commit pointpublic Map<Long,IndexCommit> getCommits()
public static long getCommitTimestamp(IndexCommit commit) throws IOException
IOExceptionpublic IndexDeletionPolicy clone()
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.