Module org.apache.lucene.core
Class Lucene90CompoundFormat
java.lang.Object
org.apache.lucene.codecs.CompoundFormat
org.apache.lucene.codecs.lucene90.Lucene90CompoundFormat
Lucene 9.0 compound file format
Files:
.cfs
: An optional "virtual" file consisting of all the other index files for systems that frequently run out of file handles..cfe
: The "virtual" compound file's entry table holding all entries in the corresponding .cfs file.
Description:
- Compound (.cfs) --> Header, FileData FileCount, Footer
- Compound Entry Table (.cfe) --> Header, FileCount, <FileName, DataOffset, DataLength> FileCount
- Header -->
IndexHeader
- FileCount -->
VInt
- DataOffset,DataLength,Checksum -->
UInt64
- FileName -->
String
- FileData --> raw file data
- Footer -->
CodecFooter
Notes:
- FileCount indicates how many files are contained in this compound file. The entry table that follows has that many entries.
- Each directory entry contains a long pointer to the start of this file's data section, the files length, and a String with that file's name. The start of file's data section is aligned to 8 bytes to not introduce additional unaligned accesses with mmap.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
(package private) static final String
Extension of compound file(package private) static final String
Extension of compound file entries(package private) static final String
(package private) static final int
(package private) static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCompoundReader
(Directory dir, SegmentInfo si, IOContext context) Returns a Directory view (read-only) for the compound files in this segmentvoid
write
(Directory dir, SegmentInfo si, IOContext context) Packs the provided segment's files into a compound format.private void
writeCompoundFile
(IndexOutput entries, IndexOutput data, Directory dir, SegmentInfo si)
-
Field Details
-
DATA_EXTENSION
Extension of compound file- See Also:
-
ENTRIES_EXTENSION
Extension of compound file entries- See Also:
-
DATA_CODEC
- See Also:
-
ENTRY_CODEC
- See Also:
-
VERSION_START
static final int VERSION_START- See Also:
-
VERSION_CURRENT
static final int VERSION_CURRENT- See Also:
-
-
Constructor Details
-
Lucene90CompoundFormat
public Lucene90CompoundFormat()Sole constructor.
-
-
Method Details
-
getCompoundReader
public CompoundDirectory getCompoundReader(Directory dir, SegmentInfo si, IOContext context) throws IOException Description copied from class:CompoundFormat
Returns a Directory view (read-only) for the compound files in this segment- Specified by:
getCompoundReader
in classCompoundFormat
- Throws:
IOException
-
write
Description copied from class:CompoundFormat
Packs the provided segment's files into a compound format. All files referenced by the providedSegmentInfo
must haveCodecUtil.writeIndexHeader(org.apache.lucene.store.DataOutput, java.lang.String, int, byte[], java.lang.String)
andCodecUtil.writeFooter(org.apache.lucene.store.IndexOutput)
.- Specified by:
write
in classCompoundFormat
- Throws:
IOException
-
writeCompoundFile
private void writeCompoundFile(IndexOutput entries, IndexOutput data, Directory dir, SegmentInfo si) throws IOException - Throws:
IOException
-