public class IndexDeletionPolicyWrapper extends Object implements IndexDeletionPolicy
IndexDeletionPolicy
Constructor and Description |
---|
IndexDeletionPolicyWrapper(IndexDeletionPolicy deletionPolicy) |
Modifier and Type | Method and Description |
---|---|
IndexCommit |
getCommitPoint(Long version) |
Map<Long,IndexCommit> |
getCommits()
Gets the commit points for the index.
|
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 list)
Internal use for Lucene... do not explicitly call.
|
void |
onInit(List list)
Internal use for Lucene... do not explicitly call.
|
void |
releaseCommitPoint(Long indexCommitVersion)
Release a previously saved commit point
|
void |
saveCommitPoint(Long indexCommitVersion)
Permanently prevent this commit point from being deleted.
|
void |
setReserveDuration(Long indexVersion,
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 indexVersion, long reserveTime)
indexVersion
- version of the commit point to be reservedreserveTime
- time in milliseconds for which the commit point is to be reservedpublic void saveCommitPoint(Long indexCommitVersion)
public void releaseCommitPoint(Long indexCommitVersion)
public void onInit(List list) throws IOException
onInit
in interface IndexDeletionPolicy
IOException
public void onCommit(List list) throws IOException
onCommit
in interface IndexDeletionPolicy
IOException
public IndexCommit getCommitPoint(Long version)
version
- the version of the commit pointpublic Map<Long,IndexCommit> getCommits()