Module org.apache.lucene.core
Package org.apache.lucene.index
Class SnapshotDeletionPolicy.SnapshotCommitPoint
java.lang.Object
org.apache.lucene.index.IndexCommit
org.apache.lucene.index.SnapshotDeletionPolicy.SnapshotCommitPoint
- All Implemented Interfaces:
Comparable<IndexCommit>
- Enclosing class:
SnapshotDeletionPolicy
Wraps a provided
IndexCommit and prevents it from being deleted.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IndexCommitTheIndexCommitwe are preventing from deletion. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates aSnapshotCommitPointwrapping the providedIndexCommit. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Delete this commit point.Returns theDirectoryfor the index.Returns all index files referenced by this commit point.longReturns the generation (the _N in segments_N) for this IndexCommitintReturns number of segments referenced by this commit.Get the segments file (segments_N) associated with this commit point.Returns userData, previously passed toIndexWriter.setLiveCommitData(Iterable)for this commit.booleanReturns true if this commit should be deleted; this is only used byIndexWriterafter invoking theIndexDeletionPolicy.toString()Methods inherited from class org.apache.lucene.index.IndexCommit
compareTo, equals, getReader, hashCode
-
Field Details
-
cp
TheIndexCommitwe are preventing from deletion.
-
-
Constructor Details
-
SnapshotCommitPoint
Creates aSnapshotCommitPointwrapping the providedIndexCommit.
-
-
Method Details
-
toString
-
delete
public void delete()Description copied from class:IndexCommitDelete this commit point. This only applies when using the commit point in the context of IndexWriter's IndexDeletionPolicy.Upon calling this, the writer is notified that this commit point should be deleted.
Decision that a commit-point should be deleted is taken by the
IndexDeletionPolicyin effect and therefore this should only be called by itsonInit()oronCommit()methods.- Specified by:
deletein classIndexCommit
-
getDirectory
Description copied from class:IndexCommitReturns theDirectoryfor the index.- Specified by:
getDirectoryin classIndexCommit
-
getFileNames
Description copied from class:IndexCommitReturns all index files referenced by this commit point.- Specified by:
getFileNamesin classIndexCommit- Throws:
IOException
-
getGeneration
public long getGeneration()Description copied from class:IndexCommitReturns the generation (the _N in segments_N) for this IndexCommit- Specified by:
getGenerationin classIndexCommit
-
getSegmentsFileName
Description copied from class:IndexCommitGet the segments file (segments_N) associated with this commit point.- Specified by:
getSegmentsFileNamein classIndexCommit
-
getUserData
Description copied from class:IndexCommitReturns userData, previously passed toIndexWriter.setLiveCommitData(Iterable)for this commit. Map isString -> String.- Specified by:
getUserDatain classIndexCommit- Throws:
IOException
-
isDeleted
public boolean isDeleted()Description copied from class:IndexCommitReturns true if this commit should be deleted; this is only used byIndexWriterafter invoking theIndexDeletionPolicy.- Specified by:
isDeletedin classIndexCommit
-
getSegmentCount
public int getSegmentCount()Description copied from class:IndexCommitReturns number of segments referenced by this commit.- Specified by:
getSegmentCountin classIndexCommit
-