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) long
private final int
(package private) String
-
Constructor Summary
ConstructorsConstructorDescriptionCommitPoint
(Collection<IndexFileDeleter.CommitPoint> commitsToDelete, Directory directoryOrig, SegmentInfos segmentInfos) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Called only be the deletion policy, to remove this commit point from the index.Returns theDirectory
for the index.Returns all index files referenced by this commit point.long
Returns the generation (the _N in segments_N) for this IndexCommitint
Returns 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.boolean
Returns true if this commit should be deleted; this is only used byIndexWriter
after 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:IndexCommit
Returns number of segments referenced by this commit.- Specified by:
getSegmentCount
in classIndexCommit
-
getSegmentsFileName
Description copied from class:IndexCommit
Get the segments file (segments_N
) associated with this commit point.- Specified by:
getSegmentsFileName
in classIndexCommit
-
getFileNames
Description copied from class:IndexCommit
Returns all index files referenced by this commit point.- Specified by:
getFileNames
in classIndexCommit
-
getDirectory
Description copied from class:IndexCommit
Returns theDirectory
for the index.- Specified by:
getDirectory
in classIndexCommit
-
getGeneration
public long getGeneration()Description copied from class:IndexCommit
Returns the generation (the _N in segments_N) for this IndexCommit- Specified by:
getGeneration
in classIndexCommit
-
getUserData
Description copied from class:IndexCommit
Returns userData, previously passed toIndexWriter.setLiveCommitData(Iterable)
for this commit. Map isString -> String
.- Specified by:
getUserData
in classIndexCommit
-
delete
public void delete()Called only be the deletion policy, to remove this commit point from the index.- Specified by:
delete
in classIndexCommit
-
isDeleted
public boolean isDeleted()Description copied from class:IndexCommit
Returns true if this commit should be deleted; this is only used byIndexWriter
after invoking theIndexDeletionPolicy
.- Specified by:
isDeleted
in classIndexCommit
-