Class Lucene50LiveDocsFormat
- java.lang.Object
-
- org.apache.lucene.codecs.LiveDocsFormat
-
- org.apache.lucene.backward_codecs.lucene50.Lucene50LiveDocsFormat
-
public final class Lucene50LiveDocsFormat extends LiveDocsFormat
Lucene 5.0 live docs formatThe .liv file is optional, and only exists when a segment contains deletions.
Although per-segment, this file is maintained exterior to compound segment files.
Deletions (.liv) --> IndexHeader,Generation,Bits
- SegmentHeader -->
IndexHeader - Bits --> <
Int64> LongCount
- SegmentHeader -->
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCODEC_NAMEcodec of live docsprivate static java.lang.StringEXTENSIONextension of live docsprivate static intVERSION_CURRENTprivate static intVERSION_STARTsupported version range
-
Constructor Summary
Constructors Constructor Description Lucene50LiveDocsFormat()Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfiles(SegmentCommitInfo info, java.util.Collection<java.lang.String> files)Records all files in use by thisSegmentCommitInfointo the files argument.private FixedBitSetreadFixedBitSet(IndexInput input, int length)BitsreadLiveDocs(Directory dir, SegmentCommitInfo info, IOContext context)Read live docs bits.private intwriteBits(IndexOutput output, Bits bits)voidwriteLiveDocs(Bits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context)Note: although this format is only used on older versions, we need to keep the write logic in addition to the read logic.
-
-
-
Field Detail
-
EXTENSION
private static final java.lang.String EXTENSION
extension of live docs- See Also:
- Constant Field Values
-
CODEC_NAME
private static final java.lang.String CODEC_NAME
codec of live docs- See Also:
- Constant Field Values
-
VERSION_START
private static final int VERSION_START
supported version range- See Also:
- Constant Field Values
-
VERSION_CURRENT
private static final int VERSION_CURRENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
readLiveDocs
public Bits readLiveDocs(Directory dir, SegmentCommitInfo info, IOContext context) throws java.io.IOException
Description copied from class:LiveDocsFormatRead live docs bits.- Specified by:
readLiveDocsin classLiveDocsFormat- Throws:
java.io.IOException
-
readFixedBitSet
private FixedBitSet readFixedBitSet(IndexInput input, int length) throws java.io.IOException
- Throws:
java.io.IOException
-
writeLiveDocs
public void writeLiveDocs(Bits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws java.io.IOException
Note: although this format is only used on older versions, we need to keep the write logic in addition to the read logic. When we delete documents that live in an older segment, we write to the live docs for that segment.- Specified by:
writeLiveDocsin classLiveDocsFormat- Throws:
java.io.IOException
-
writeBits
private int writeBits(IndexOutput output, Bits bits) throws java.io.IOException
- Throws:
java.io.IOException
-
files
public void files(SegmentCommitInfo info, java.util.Collection<java.lang.String> files) throws java.io.IOException
Description copied from class:LiveDocsFormatRecords all files in use by thisSegmentCommitInfointo the files argument.- Specified by:
filesin classLiveDocsFormat- Throws:
java.io.IOException
-
-