public final class CompressingStoredFieldsIndexWriter
extends java.lang.Object
implements java.io.Closeable
Codecs.
This writer generates a file which can be loaded into memory using memory-efficient data structures to quickly locate the block that contains any document.
In order to have a compact in-memory representation, for every block of 1024 chunks, this index computes the average number of bytes per chunk and for every chunk, only stores the difference between
Data is written as follows:
PackedInts.VERSION_CURRENT as a VIntVInt, this marks the end of blocks since blocks are not allowed to start with 0VInt which is the number of chunks encoded in the blockVIntVIntpacked array of BlockChunks elements of BitsPerDocBaseDelta bits each, representing the deltas from the average doc base using ZigZag encoding.VLongVLongpacked array of BlockChunks elements of BitsPerStartPointerDelta bits each, representing the deltas from the average start pointer using ZigZag encodingCodecFooterNotes
DocBase + AvgChunkDocs * n + DocBaseDeltas[n].StartPointerBase + AvgChunkSize * n + StartPointerDeltas[n].| Modifier and Type | Field and Description |
|---|---|
(package private) int |
blockChunks |
(package private) int |
blockDocs |
(package private) int |
blockSize |
(package private) int[] |
docBaseDeltas |
(package private) IndexOutput |
fieldsIndexOut |
(package private) long |
firstStartPointer |
(package private) long |
maxStartPointer |
(package private) long[] |
startPointerDeltas |
(package private) int |
totalDocs |
| Constructor and Description |
|---|
CompressingStoredFieldsIndexWriter(IndexOutput indexOutput,
int blockSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
(package private) void |
finish(int numDocs,
long maxPointer) |
private void |
reset() |
private void |
writeBlock() |
(package private) void |
writeIndex(int numDocs,
long startPointer) |
final IndexOutput fieldsIndexOut
final int blockSize
int totalDocs
int blockDocs
int blockChunks
long firstStartPointer
long maxStartPointer
final int[] docBaseDeltas
final long[] startPointerDeltas
CompressingStoredFieldsIndexWriter(IndexOutput indexOutput, int blockSize) throws java.io.IOException
java.io.IOExceptionprivate void reset()
private void writeBlock()
throws java.io.IOException
java.io.IOExceptionvoid writeIndex(int numDocs,
long startPointer)
throws java.io.IOException
java.io.IOExceptionvoid finish(int numDocs,
long maxPointer)
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException