java.lang.Object
org.apache.lucene.index.IndexCommit
org.apache.lucene.index.IndexFileDeleter.CommitPoint
- All Implemented Interfaces:
Comparable<IndexCommit>
- Enclosing class:
IndexFileDeleter
Holds details for each commit point. This class is also passed to the deletion policy. Note:
this class has a natural ordering that is inconsistent with equals.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Collection<IndexFileDeleter.CommitPoint> (package private) boolean(package private) Directory(package private) Collection<String> (package private) longprivate final int(package private) String -
Constructor Summary
ConstructorsConstructorDescriptionCommitPoint(Collection<IndexFileDeleter.CommitPoint> commitsToDelete, Directory directoryOrig, SegmentInfos segmentInfos) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Called only be the deletion policy, to remove this commit point from the index.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
-
files
Collection<String> files -
segmentsFileName
String segmentsFileName -
deleted
boolean deleted -
directoryOrig
Directory directoryOrig -
commitsToDelete
Collection<IndexFileDeleter.CommitPoint> commitsToDelete -
generation
long generation -
userData
-
segmentCount
private final int segmentCount
-
-
Constructor Details
-
CommitPoint
public CommitPoint(Collection<IndexFileDeleter.CommitPoint> commitsToDelete, Directory directoryOrig, SegmentInfos segmentInfos) throws IOException - Throws:
IOException
-
-
Method Details
-
toString
-
getSegmentCount
public int getSegmentCount()Description copied from class:IndexCommitReturns number of segments referenced by this commit.- Specified by:
getSegmentCountin classIndexCommit
-
getSegmentsFileName
Description copied from class:IndexCommitGet the segments file (segments_N) associated with this commit point.- Specified by:
getSegmentsFileNamein classIndexCommit
-
getFileNames
Description copied from class:IndexCommitReturns all index files referenced by this commit point.- Specified by:
getFileNamesin classIndexCommit
-
getDirectory
Description copied from class:IndexCommitReturns theDirectoryfor the index.- Specified by:
getDirectoryin classIndexCommit
-
getGeneration
public long getGeneration()Description copied from class:IndexCommitReturns the generation (the _N in segments_N) for this IndexCommit- Specified by:
getGenerationin classIndexCommit
-
getUserData
Description copied from class:IndexCommitReturns userData, previously passed toIndexWriter.setLiveCommitData(Iterable)for this commit. Map isString -> String.- Specified by:
getUserDatain classIndexCommit
-
delete
public void delete()Called only be the deletion policy, to remove this commit point from the index.- Specified by:
deletein classIndexCommit
-
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
-