Package org.apache.lucene.index
Class StandardDirectoryReader.ReaderCommit
java.lang.Object
org.apache.lucene.index.IndexCommit
org.apache.lucene.index.StandardDirectoryReader.ReaderCommit
- All Implemented Interfaces:
Comparable<IndexCommit>
- Enclosing class:
- StandardDirectoryReader
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Directory
(package private) Collection<String>
(package private) long
private final StandardDirectoryReader
private final int
private String
-
Constructor Summary
ConstructorsConstructorDescriptionReaderCommit
(StandardDirectoryReader reader, SegmentInfos infos, Directory dir) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Delete this commit point.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 IndexCommit(package private) StandardDirectoryReader
Package-private API for IndexWriter to init from a commit-point pulled from an NRT or non-NRT reader.int
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, hashCode
-
Field Details
-
segmentsFileName
-
files
Collection<String> files -
dir
Directory dir -
generation
long generation -
userData
-
segmentCount
private final int segmentCount -
reader
-
-
Constructor Details
-
ReaderCommit
ReaderCommit(StandardDirectoryReader reader, SegmentInfos infos, Directory dir) 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
-
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
-
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()Description copied from class:IndexCommit
Delete 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
IndexDeletionPolicy
in effect and therefore this should only be called by itsonInit()
oronCommit()
methods.- Specified by:
delete
in classIndexCommit
-
getReader
StandardDirectoryReader getReader()Description copied from class:IndexCommit
Package-private API for IndexWriter to init from a commit-point pulled from an NRT or non-NRT reader.- Overrides:
getReader
in classIndexCommit
-