java.lang.Object
org.apache.lucene.index.SegmentCommitInfo
Embeds a [read-only] SegmentInfo and adds per-commit fields.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate intprivate longprivate longprivate longprivate byte[]Id that uniquely identifies this segment commit.final SegmentInfoTheSegmentInfothat we wrap.private longprivate longprivate longprivate longprivate int -
Constructor Summary
ConstructorsConstructorDescriptionSegmentCommitInfo(SegmentInfo info, int delCount, int softDelCount, long delGen, long fieldInfosGen, long docValuesGen, byte[] id) Sole constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) voidCalled when we succeed in writing deletes(package private) voidCalled when we succeed in writing a new DocValues generation.(package private) voidCalled when we succeed in writing a new FieldInfos generation.(package private) voidCalled if there was an exception while writing deletes, so that we don't try to write to the same file more than once.(package private) voidCalled if there was an exception while writing a new generation of DocValues, so that we don't try to write to the same file more than once.(package private) voidCalled if there was an exception while writing a new generation of FieldInfos, so that we don't try to write to the same file more than once.clone()files()Returns all files in use by this segment.private void(package private) longintReturns the number of deleted docs in the segment.(package private) final intgetDelCount(boolean includeSoftDeletes) longReturns generation number of the live docs file or -1 if there are no deletes yet.longReturns the generation number of the DocValues file or -1 if there are no doc-values updates yet.Returns the per-field DocValues updates files.Returns the FieldInfos file names.longReturns 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 ornullif there is no ID assigned.longReturns the next available generation number of the live docs file.longReturns the next available generation number of the DocValues files.longReturns the next available generation number of the FieldInfos files.(package private) longGets the nextWriteDelGen.(package private) longGets the nextWriteDocValuesGen.(package private) longGets the nextWriteFieldInfosGen.intReturns the number of only soft-deleted docs.booleanReturns true if there are any deletions for the segment at this commit.booleanReturns true if there are any field updates for the segment in this commit.(package private) voidsetBufferedDeletesGen(long v) (package private) voidsetDelCount(int delCount) voidsetDocValuesUpdatesFiles(Map<Integer, Set<String>> dvUpdatesFiles) Sets the DocValues updates file names, per field number.voidsetFieldInfosFiles(Set<String> fieldInfosFiles) Sets the FieldInfos file names.(package private) voidsetNextWriteDelGen(long v) Sets the nextWriteDelGen.(package private) voidsetNextWriteDocValuesGen(long v) Sets the nextWriteDocValuesGen.(package private) voidsetNextWriteFieldInfosGen(long v) Sets the nextWriteFieldInfosGen.(package private) voidsetSoftDelCount(int softDelCount) longReturns total size in bytes of all files for this segment.toString()toString(int pendingDelCount) Returns a description of this segment.
-
Field Details
-
info
TheSegmentInfothat we wrap. -
id
private byte[] idId that uniquely identifies this segment commit. -
delCount
private int delCount -
softDelCount
private int softDelCount -
delGen
private long delGen -
nextWriteDelGen
private long nextWriteDelGen -
fieldInfosGen
private long fieldInfosGen -
nextWriteFieldInfosGen
private long nextWriteFieldInfosGen -
docValuesGen
private long docValuesGen -
nextWriteDocValuesGen
private long nextWriteDocValuesGen -
dvUpdatesFiles
-
fieldInfosFiles
-
sizeInBytes
private volatile long sizeInBytes -
bufferedDeletesGen
private long bufferedDeletesGen
-
-
Constructor Details
-
SegmentCommitInfo
public SegmentCommitInfo(SegmentInfo info, int delCount, int softDelCount, long delGen, long fieldInfosGen, long docValuesGen, byte[] id) Sole constructor.- Parameters:
info-SegmentInfothat 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 Details
-
getDocValuesUpdatesFiles
Returns the per-field DocValues updates files. -
setDocValuesUpdatesFiles
Sets the DocValues updates file names, per field number. Does not deep clone the map. -
getFieldInfosFiles
Returns the FieldInfos file names. -
setFieldInfosFiles
Sets the FieldInfos file names. -
advanceDelGen
void advanceDelGen()Called when we succeed in writing deletes -
advanceNextWriteDelGen
void advanceNextWriteDelGen()Called if there was an exception while writing deletes, so that we don't try to write to the same file more than once. -
getNextWriteDelGen
long getNextWriteDelGen()Gets the nextWriteDelGen. -
setNextWriteDelGen
void setNextWriteDelGen(long v) Sets the nextWriteDelGen. -
advanceFieldInfosGen
void advanceFieldInfosGen()Called when we succeed in writing a new FieldInfos generation. -
advanceNextWriteFieldInfosGen
void advanceNextWriteFieldInfosGen()Called if there was an exception while writing a new generation of FieldInfos, so that we don't try to write to the same file more than once. -
getNextWriteFieldInfosGen
long getNextWriteFieldInfosGen()Gets the nextWriteFieldInfosGen. -
setNextWriteFieldInfosGen
void setNextWriteFieldInfosGen(long v) Sets the nextWriteFieldInfosGen. -
advanceDocValuesGen
void advanceDocValuesGen()Called when we succeed in writing a new DocValues generation. -
advanceNextWriteDocValuesGen
void advanceNextWriteDocValuesGen()Called if there was an exception while writing a new generation of DocValues, so that we don't try to write to the same file more than once. -
getNextWriteDocValuesGen
long getNextWriteDocValuesGen()Gets the nextWriteDocValuesGen. -
setNextWriteDocValuesGen
void setNextWriteDocValuesGen(long v) Sets the nextWriteDocValuesGen. -
sizeInBytes
Returns total size in bytes of all files for this segment.- Throws:
IOException
-
files
Returns all files in use by this segment.- Throws:
IOException
-
getBufferedDeletesGen
long getBufferedDeletesGen() -
setBufferedDeletesGen
void setBufferedDeletesGen(long v) -
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. -
setDelCount
void setDelCount(int delCount) -
setSoftDelCount
void setSoftDelCount(int softDelCount) -
toString
Returns a description of this segment. -
toString
-
clone
-
getDelCount
final int getDelCount(boolean includeSoftDeletes) -
generationAdvanced
private void generationAdvanced() -
getId
public byte[] getId()Returns and Id that uniquely identifies this segment commit ornullif there is no ID assigned. This ID changes each time the the segment changes due to a delete, doc-value or field update.
-