Package org.apache.lucene.index
Class IndexFileDeleter.CommitPoint
- java.lang.Object
-
- org.apache.lucene.index.IndexCommit
-
- org.apache.lucene.index.IndexFileDeleter.CommitPoint
-
- All Implemented Interfaces:
java.lang.Comparable<IndexCommit>
- Enclosing class:
- IndexFileDeleter
private static final class IndexFileDeleter.CommitPoint extends IndexCommit
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
Fields Modifier and Type Field Description (package private) java.util.Collection<IndexFileDeleter.CommitPoint>
commitsToDelete
(package private) boolean
deleted
(package private) Directory
directoryOrig
(package private) java.util.Collection<java.lang.String>
files
(package private) long
generation
private int
segmentCount
(package private) java.lang.String
segmentsFileName
(package private) java.util.Map<java.lang.String,java.lang.String>
userData
-
Constructor Summary
Constructors Constructor Description CommitPoint(java.util.Collection<IndexFileDeleter.CommitPoint> commitsToDelete, Directory directoryOrig, SegmentInfos segmentInfos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
Called only be the deletion policy, to remove this commit point from the index.Directory
getDirectory()
Returns theDirectory
for the index.java.util.Collection<java.lang.String>
getFileNames()
Returns all index files referenced by this commit point.long
getGeneration()
Returns the generation (the _N in segments_N) for this IndexCommitint
getSegmentCount()
Returns number of segments referenced by this commit.java.lang.String
getSegmentsFileName()
Get the segments file (segments_N
) associated with this commit point.java.util.Map<java.lang.String,java.lang.String>
getUserData()
Returns userData, previously passed toIndexWriter.setLiveCommitData(Iterable)
for this commit.boolean
isDeleted()
Returns true if this commit should be deleted; this is only used byIndexWriter
after invoking theIndexDeletionPolicy
.java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.index.IndexCommit
compareTo, equals, getReader, hashCode
-
-
-
-
Field Detail
-
files
java.util.Collection<java.lang.String> files
-
segmentsFileName
java.lang.String segmentsFileName
-
deleted
boolean deleted
-
directoryOrig
Directory directoryOrig
-
commitsToDelete
java.util.Collection<IndexFileDeleter.CommitPoint> commitsToDelete
-
generation
long generation
-
userData
final java.util.Map<java.lang.String,java.lang.String> userData
-
segmentCount
private final int segmentCount
-
-
Constructor Detail
-
CommitPoint
public CommitPoint(java.util.Collection<IndexFileDeleter.CommitPoint> commitsToDelete, Directory directoryOrig, SegmentInfos segmentInfos) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSegmentCount
public int getSegmentCount()
Description copied from class:IndexCommit
Returns number of segments referenced by this commit.- Specified by:
getSegmentCount
in classIndexCommit
-
getSegmentsFileName
public java.lang.String getSegmentsFileName()
Description copied from class:IndexCommit
Get the segments file (segments_N
) associated with this commit point.- Specified by:
getSegmentsFileName
in classIndexCommit
-
getFileNames
public java.util.Collection<java.lang.String> getFileNames()
Description copied from class:IndexCommit
Returns all index files referenced by this commit point.- Specified by:
getFileNames
in classIndexCommit
-
getDirectory
public Directory 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
public java.util.Map<java.lang.String,java.lang.String> 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
-
-