public class IndexDeletionPolicyWrapper
extends java.lang.Object
implements org.apache.lucene.index.IndexDeletionPolicy
IndexDeletionPolicy| Modifier and Type | Class and Description |
|---|---|
private class |
IndexDeletionPolicyWrapper.IndexCommitWrapper |
| Modifier and Type | Field and Description |
|---|---|
private org.apache.lucene.index.IndexDeletionPolicy |
deletionPolicy |
private org.apache.lucene.index.IndexCommit |
latestCommit |
private java.util.Map<java.lang.Long,java.lang.Long> |
reserves |
private java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.util.concurrent.atomic.AtomicInteger> |
savedCommits |
private java.util.Map<java.lang.Long,org.apache.lucene.index.IndexCommit> |
solrVersionVsCommits |
| Constructor and Description |
|---|
IndexDeletionPolicyWrapper(org.apache.lucene.index.IndexDeletionPolicy deletionPolicy) |
| Modifier and Type | Method and Description |
|---|---|
private void |
cleanReserves() |
org.apache.lucene.index.IndexCommit |
getCommitPoint(java.lang.Long version) |
java.util.Map<java.lang.Long,org.apache.lucene.index.IndexCommit> |
getCommits()
Gets the commit points for the index.
|
org.apache.lucene.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
|
org.apache.lucene.index.IndexDeletionPolicy |
getWrappedDeletionPolicy() |
void |
onCommit(java.util.List list)
Internal use for Lucene...
|
void |
onInit(java.util.List list)
Internal use for Lucene...
|
void |
releaseCommitPoint(java.lang.Long indexCommitVersion)
Release a previously saved commit point
|
void |
saveCommitPoint(java.lang.Long indexCommitVersion)
Permanently prevent this commit point from being deleted.
|
void |
setReserveDuration(java.lang.Long indexVersion,
long reserveTime)
Set the duration for which commit point is to be reserved by the deletion policy.
|
private void |
updateCommitPoints(java.util.List<IndexDeletionPolicyWrapper.IndexCommitWrapper> list) |
private java.util.List<IndexDeletionPolicyWrapper.IndexCommitWrapper> |
wrap(java.util.List<org.apache.lucene.index.IndexCommit> list) |
private final org.apache.lucene.index.IndexDeletionPolicy deletionPolicy
private volatile java.util.Map<java.lang.Long,org.apache.lucene.index.IndexCommit> solrVersionVsCommits
private final java.util.Map<java.lang.Long,java.lang.Long> reserves
private volatile org.apache.lucene.index.IndexCommit latestCommit
private final java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.util.concurrent.atomic.AtomicInteger> savedCommits
public IndexDeletionPolicyWrapper(org.apache.lucene.index.IndexDeletionPolicy deletionPolicy)
public org.apache.lucene.index.IndexCommit getLatestCommit()
public org.apache.lucene.index.IndexDeletionPolicy getWrappedDeletionPolicy()
public void setReserveDuration(java.lang.Long indexVersion,
long reserveTime)
indexVersion - version of the commit point to be reservedreserveTime - time in milliseconds for which the commit point is to be reservedprivate void cleanReserves()
private java.util.List<IndexDeletionPolicyWrapper.IndexCommitWrapper> wrap(java.util.List<org.apache.lucene.index.IndexCommit> list)
public void saveCommitPoint(java.lang.Long indexCommitVersion)
public void releaseCommitPoint(java.lang.Long indexCommitVersion)
public void onInit(java.util.List list)
throws java.io.IOException
onInit in interface org.apache.lucene.index.IndexDeletionPolicyjava.io.IOExceptionpublic void onCommit(java.util.List list)
throws java.io.IOException
onCommit in interface org.apache.lucene.index.IndexDeletionPolicyjava.io.IOExceptionpublic org.apache.lucene.index.IndexCommit getCommitPoint(java.lang.Long version)
version - the version of the commit pointpublic java.util.Map<java.lang.Long,org.apache.lucene.index.IndexCommit> getCommits()
private void updateCommitPoints(java.util.List<IndexDeletionPolicyWrapper.IndexCommitWrapper> list)