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:
java.lang.Comparable<IndexCommit>
- Enclosing class:
- StandardDirectoryReader
static final class StandardDirectoryReader.ReaderCommit extends IndexCommit
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Directorydir(package private) java.util.Collection<java.lang.String>files(package private) longgenerationprivate StandardDirectoryReaderreaderprivate intsegmentCountprivate java.lang.StringsegmentsFileName(package private) java.util.Map<java.lang.String,java.lang.String>userData
-
Constructor Summary
Constructors Constructor Description ReaderCommit(StandardDirectoryReader reader, SegmentInfos infos, Directory dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()Delete this commit point.DirectorygetDirectory()Returns theDirectoryfor the index.java.util.Collection<java.lang.String>getFileNames()Returns all index files referenced by this commit point.longgetGeneration()Returns the generation (the _N in segments_N) for this IndexCommit(package private) StandardDirectoryReadergetReader()Package-private API for IndexWriter to init from a commit-point pulled from an NRT or non-NRT reader.intgetSegmentCount()Returns number of segments referenced by this commit.java.lang.StringgetSegmentsFileName()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.booleanisDeleted()Returns true if this commit should be deleted; this is only used byIndexWriterafter invoking theIndexDeletionPolicy.java.lang.StringtoString()-
Methods inherited from class org.apache.lucene.index.IndexCommit
compareTo, equals, hashCode
-
-
-
-
Field Detail
-
segmentsFileName
private java.lang.String segmentsFileName
-
files
java.util.Collection<java.lang.String> files
-
dir
Directory dir
-
generation
long generation
-
userData
final java.util.Map<java.lang.String,java.lang.String> userData
-
segmentCount
private final int segmentCount
-
reader
private final StandardDirectoryReader reader
-
-
Constructor Detail
-
ReaderCommit
ReaderCommit(StandardDirectoryReader reader, SegmentInfos infos, Directory dir) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSegmentCount
public int getSegmentCount()
Description copied from class:IndexCommitReturns number of segments referenced by this commit.- Specified by:
getSegmentCountin classIndexCommit
-
getSegmentsFileName
public java.lang.String getSegmentsFileName()
Description copied from class:IndexCommitGet the segments file (segments_N) associated with this commit point.- Specified by:
getSegmentsFileNamein classIndexCommit
-
getFileNames
public java.util.Collection<java.lang.String> getFileNames()
Description copied from class:IndexCommitReturns all index files referenced by this commit point.- Specified by:
getFileNamesin classIndexCommit
-
getDirectory
public Directory 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
-
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
-
getUserData
public java.util.Map<java.lang.String,java.lang.String> 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()
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
-
getReader
StandardDirectoryReader getReader()
Description copied from class:IndexCommitPackage-private API for IndexWriter to init from a commit-point pulled from an NRT or non-NRT reader.- Overrides:
getReaderin classIndexCommit
-
-