Class FieldsIndexWriter
- java.lang.Object
-
- org.apache.lucene.codecs.compressing.FieldsIndexWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public final class FieldsIndexWriter extends java.lang.Object implements java.io.Closeable
Efficient index format for block-basedCodec
s.For each block of compressed stored fields, this stores the first document of the block and the start pointer of the block in a
DirectMonotonicWriter
. At read time, the docID is binary-searched in theDirectMonotonicReader
that records doc IDS, and the returned index is used to look up the start pointer in theDirectMonotonicReader
that records start pointers.
-
-
Field Summary
Fields Modifier and Type Field Description private int
blockShift
private java.lang.String
codecName
private Directory
dir
private IndexOutput
docsOut
private java.lang.String
extension
private IndexOutput
filePointersOut
private byte[]
id
private IOContext
ioContext
private java.lang.String
name
private long
previousFP
private java.lang.String
suffix
private int
totalChunks
private int
totalDocs
(package private) static int
VERSION_CURRENT
(package private) static int
VERSION_START
-
Constructor Summary
Constructors Constructor Description FieldsIndexWriter(Directory dir, java.lang.String name, java.lang.String suffix, java.lang.String extension, java.lang.String codecName, byte[] id, int blockShift, IOContext ioContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
(package private) void
finish(int numDocs, long maxPointer, IndexOutput metaOut)
(package private) void
writeIndex(int numDocs, long startPointer)
-
-
-
Field Detail
-
VERSION_START
static final int VERSION_START
- See Also:
- Constant Field Values
-
VERSION_CURRENT
static final int VERSION_CURRENT
- See Also:
- Constant Field Values
-
dir
private final Directory dir
-
name
private final java.lang.String name
-
suffix
private final java.lang.String suffix
-
extension
private final java.lang.String extension
-
codecName
private final java.lang.String codecName
-
id
private final byte[] id
-
blockShift
private final int blockShift
-
ioContext
private final IOContext ioContext
-
docsOut
private IndexOutput docsOut
-
filePointersOut
private IndexOutput filePointersOut
-
totalDocs
private int totalDocs
-
totalChunks
private int totalChunks
-
previousFP
private long previousFP
-
-
Method Detail
-
writeIndex
void writeIndex(int numDocs, long startPointer) throws java.io.IOException
- Throws:
java.io.IOException
-
finish
void finish(int numDocs, long maxPointer, IndexOutput metaOut) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-