Package org.apache.lucene.index
Class SegmentCommitInfo
- java.lang.Object
-
- org.apache.lucene.index.SegmentCommitInfo
-
public class SegmentCommitInfo extends Object
Embeds a [read-only] SegmentInfo and adds per-commit fields.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description SegmentInfo
info
TheSegmentInfo
that we wrap.
-
Constructor Summary
Constructors Constructor Description SegmentCommitInfo(SegmentInfo info, int delCount, int softDelCount, long delGen, long fieldInfosGen, long docValuesGen, byte[] id)
Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SegmentCommitInfo
clone()
Collection<String>
files()
Returns all files in use by this segment.int
getDelCount()
Returns the number of deleted docs in the segment.long
getDelGen()
Returns generation number of the live docs file or -1 if there are no deletes yet.long
getDocValuesGen()
Returns the generation number of the DocValues file or -1 if there are no doc-values updates yet.Map<Integer,Set<String>>
getDocValuesUpdatesFiles()
Returns the per-field DocValues updates files.Set<String>
getFieldInfosFiles()
Returns the FieldInfos file names.long
getFieldInfosGen()
Returns the generation number of the field infos file or -1 if there are no field updates yet.byte[]
getId()
Returns and Id that uniquely identifies this segment commit ornull
if there is no ID assigned.long
getNextDelGen()
Returns the next available generation number of the live docs file.long
getNextDocValuesGen()
Returns the next available generation number of the DocValues files.long
getNextFieldInfosGen()
Returns the next available generation number of the FieldInfos files.int
getSoftDelCount()
Returns the number of only soft-deleted docs.boolean
hasDeletions()
Returns true if there are any deletions for the segment at this commit.boolean
hasFieldUpdates()
Returns true if there are any field updates for the segment in this commit.void
setDocValuesUpdatesFiles(Map<Integer,Set<String>> dvUpdatesFiles)
Sets the DocValues updates file names, per field number.void
setFieldInfosFiles(Set<String> fieldInfosFiles)
Sets the FieldInfos file names.long
sizeInBytes()
Returns total size in bytes of all files for this segment.String
toString()
String
toString(int pendingDelCount)
Returns a description of this segment.
-
-
-
Field Detail
-
info
public final SegmentInfo info
TheSegmentInfo
that we wrap.
-
-
Constructor Detail
-
SegmentCommitInfo
public SegmentCommitInfo(SegmentInfo info, int delCount, int softDelCount, long delGen, long fieldInfosGen, long docValuesGen, byte[] id)
Sole constructor.- Parameters:
info
-SegmentInfo
that we wrapdelCount
- number of deleted documents in this segmentdelGen
- deletion generation number (used to name deletion files)fieldInfosGen
- FieldInfos generation number (used to name field-infos files)docValuesGen
- DocValues generation number (used to name doc-values updates files)id
- Id that uniquely identifies this segment commit. This id must be 16 bytes long. SeeStringHelper.randomId()
-
-
Method Detail
-
getDocValuesUpdatesFiles
public Map<Integer,Set<String>> getDocValuesUpdatesFiles()
Returns the per-field DocValues updates files.
-
setDocValuesUpdatesFiles
public void setDocValuesUpdatesFiles(Map<Integer,Set<String>> dvUpdatesFiles)
Sets the DocValues updates file names, per field number. Does not deep clone the map.
-
setFieldInfosFiles
public void setFieldInfosFiles(Set<String> fieldInfosFiles)
Sets the FieldInfos file names.
-
sizeInBytes
public long sizeInBytes() throws IOException
Returns total size in bytes of all files for this segment.- Throws:
IOException
-
files
public Collection<String> files() throws IOException
Returns all files in use by this segment.- Throws:
IOException
-
hasDeletions
public boolean hasDeletions()
Returns true if there are any deletions for the segment at this commit.
-
hasFieldUpdates
public boolean hasFieldUpdates()
Returns true if there are any field updates for the segment in this commit.
-
getNextFieldInfosGen
public long getNextFieldInfosGen()
Returns the next available generation number of the FieldInfos files.
-
getFieldInfosGen
public long getFieldInfosGen()
Returns the generation number of the field infos file or -1 if there are no field updates yet.
-
getNextDocValuesGen
public long getNextDocValuesGen()
Returns the next available generation number of the DocValues files.
-
getDocValuesGen
public long getDocValuesGen()
Returns the generation number of the DocValues file or -1 if there are no doc-values updates yet.
-
getNextDelGen
public long getNextDelGen()
Returns the next available generation number of the live docs file.
-
getDelGen
public long getDelGen()
Returns generation number of the live docs file or -1 if there are no deletes yet.
-
getDelCount
public int getDelCount()
Returns the number of deleted docs in the segment.
-
getSoftDelCount
public int getSoftDelCount()
Returns the number of only soft-deleted docs.
-
toString
public String toString(int pendingDelCount)
Returns a description of this segment.
-
clone
public SegmentCommitInfo clone()
-
getId
public byte[] getId()
Returns and Id that uniquely identifies this segment commit ornull
if there is no ID assigned. This ID changes each time the the segment changes due to a delete, doc-value or field update.
-
-