Package org.apache.lucene.index
Class SegmentCommitInfo
- java.lang.Object
-
- org.apache.lucene.index.SegmentCommitInfo
-
public class SegmentCommitInfo extends java.lang.ObjectEmbeds a [read-only] SegmentInfo and adds per-commit fields.
-
-
Field Summary
Fields Modifier and Type Field Description SegmentInfoinfoTheSegmentInfothat we wrap.
-
Constructor Summary
Constructors Constructor Description SegmentCommitInfo(SegmentInfo info, int delCount, long delGen, long fieldInfosGen)Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SegmentCommitInfoclone()java.util.Collection<java.lang.String>files()Returns all files in use by this segment.intgetDelCount()Returns the number of deleted docs in the segment.longgetDelGen()Returns generation number of the live docs file or -1 if there are no deletes yet.longgetFieldInfosGen()Returns the generation number of the field infos file or -1 if there are no field updates yet.longgetNextDelGen()Returns the next available generation number of the live docs file.longgetNextFieldInfosGen()Returns the next available generation number of the FieldInfos files.java.util.Map<java.lang.Long,java.util.Set<java.lang.String>>getUpdatesFiles()Returns the per generation updates files.booleanhasDeletions()Returns true if there are any deletions for the segment at this commit.booleanhasFieldUpdates()Returns true if there are any field updates for the segment in this commit.voidsetGenUpdatesFiles(java.util.Map<java.lang.Long,java.util.Set<java.lang.String>> genUpdatesFiles)Sets the updates file names per generation.longsizeInBytes()Returns total size in bytes of all files for this segment.java.lang.StringtoString()java.lang.StringtoString(Directory dir, int pendingDelCount)Returns a description of this segment.
-
-
-
Field Detail
-
info
public final SegmentInfo info
TheSegmentInfothat we wrap.
-
-
Constructor Detail
-
SegmentCommitInfo
public SegmentCommitInfo(SegmentInfo info, int delCount, long delGen, long fieldInfosGen)
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)
-
-
Method Detail
-
getUpdatesFiles
public java.util.Map<java.lang.Long,java.util.Set<java.lang.String>> getUpdatesFiles()
Returns the per generation updates files.
-
setGenUpdatesFiles
public void setGenUpdatesFiles(java.util.Map<java.lang.Long,java.util.Set<java.lang.String>> genUpdatesFiles)
Sets the updates file names per generation. Does not deep clone the map.
-
sizeInBytes
public long sizeInBytes() throws java.io.IOExceptionReturns total size in bytes of all files for this segment.NOTE: This value is not correct for 3.0 segments that have shared docstores. To get the correct value, upgrade!
- Throws:
java.io.IOException
-
files
public java.util.Collection<java.lang.String> files() throws java.io.IOExceptionReturns all files in use by this segment.- Throws:
java.io.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.
-
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.
-
toString
public java.lang.String toString(Directory dir, int pendingDelCount)
Returns a description of this segment.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clone
public SegmentCommitInfo clone()
-
-