static final class StandardDirectoryReader.ReaderCommit extends IndexCommit
Modifier and Type | Field and Description |
---|---|
(package private) Directory |
dir |
(package private) java.util.Collection<java.lang.String> |
files |
(package private) long |
generation |
private StandardDirectoryReader |
reader |
private int |
segmentCount |
private java.lang.String |
segmentsFileName |
(package private) java.util.Map<java.lang.String,java.lang.String> |
userData |
Constructor and Description |
---|
ReaderCommit(StandardDirectoryReader reader,
SegmentInfos infos,
Directory dir) |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Delete this commit point.
|
Directory |
getDirectory()
Returns the
Directory 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
IndexCommit
|
(package private) StandardDirectoryReader |
getReader()
Package-private API for IndexWriter to init from a commit-point pulled from an NRT or non-NRT reader.
|
int |
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 to
IndexWriter.setLiveCommitData(Iterable) for this commit. |
boolean |
isDeleted()
Returns true if this commit should be deleted; this is
only used by
IndexWriter after invoking the
IndexDeletionPolicy . |
java.lang.String |
toString() |
compareTo, equals, hashCode
private java.lang.String segmentsFileName
java.util.Collection<java.lang.String> files
Directory dir
long generation
final java.util.Map<java.lang.String,java.lang.String> userData
private final int segmentCount
private final StandardDirectoryReader reader
ReaderCommit(StandardDirectoryReader reader, SegmentInfos infos, Directory dir) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public int getSegmentCount()
IndexCommit
getSegmentCount
in class IndexCommit
public java.lang.String getSegmentsFileName()
IndexCommit
segments_N
) associated
with this commit point.getSegmentsFileName
in class IndexCommit
public java.util.Collection<java.lang.String> getFileNames()
IndexCommit
getFileNames
in class IndexCommit
public Directory getDirectory()
IndexCommit
Directory
for the index.getDirectory
in class IndexCommit
public long getGeneration()
IndexCommit
getGeneration
in class IndexCommit
public boolean isDeleted()
IndexCommit
IndexWriter
after invoking the
IndexDeletionPolicy
.isDeleted
in class IndexCommit
public java.util.Map<java.lang.String,java.lang.String> getUserData()
IndexCommit
IndexWriter.setLiveCommitData(Iterable)
for this commit. Map is
String -> String
.getUserData
in class IndexCommit
public void delete()
IndexCommit
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 its onInit()
or
onCommit()
methods.
delete
in class IndexCommit
StandardDirectoryReader getReader()
IndexCommit
getReader
in class IndexCommit