public class BlockTreeTermsWriter extends FieldsConsumer
Writes terms dict and index, block-encoding (column stride) each term's metadata for each set of terms between two index terms.
BlockTreeTermsReader| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_BLOCK_SIZE
Suggested default value for the
maxItemsInBlock parameter to BlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int). |
static int |
DEFAULT_MIN_BLOCK_SIZE
Suggested default value for the
minItemsInBlock parameter to BlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int). |
static int |
TERMS_INDEX_VERSION_CURRENT
Current index format.
|
static int |
TERMS_INDEX_VERSION_START
Initial index format.
|
static int |
TERMS_VERSION_CURRENT
Current terms format.
|
static int |
TERMS_VERSION_START
Initial terms format.
|
| Constructor and Description |
|---|
BlockTreeTermsWriter(SegmentWriteState state,
PostingsWriterBase postingsWriter,
int minItemsInBlock,
int maxItemsInBlock)
Create a new writer.
|
| Modifier and Type | Method and Description |
|---|---|
TermsConsumer |
addField(FieldInfo field)
Add a new field
|
void |
close()
Called when we are done adding everything.
|
protected void |
writeHeader(IndexOutput out)
Writes the terms file header.
|
protected void |
writeIndexHeader(IndexOutput out)
Writes the index file header.
|
protected void |
writeIndexTrailer(IndexOutput indexOut,
long dirStart)
Writes the index file trailer.
|
protected void |
writeTrailer(IndexOutput out,
long dirStart)
Writes the terms file trailer.
|
mergepublic static final int DEFAULT_MIN_BLOCK_SIZE
minItemsInBlock parameter to BlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).public static final int DEFAULT_MAX_BLOCK_SIZE
maxItemsInBlock parameter to BlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).public static final int TERMS_VERSION_START
public static final int TERMS_VERSION_CURRENT
public static final int TERMS_INDEX_VERSION_START
public static final int TERMS_INDEX_VERSION_CURRENT
public BlockTreeTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter, int minItemsInBlock, int maxItemsInBlock) throws IOException
IOExceptionprotected void writeHeader(IndexOutput out) throws IOException
IOExceptionprotected void writeIndexHeader(IndexOutput out) throws IOException
IOExceptionprotected void writeTrailer(IndexOutput out, long dirStart) throws IOException
IOExceptionprotected void writeIndexTrailer(IndexOutput indexOut, long dirStart) throws IOException
IOExceptionpublic TermsConsumer addField(FieldInfo field) throws IOException
FieldsConsumeraddField in class FieldsConsumerIOExceptionpublic void close()
throws IOException
FieldsConsumerclose in interface Closeableclose in class FieldsConsumerIOExceptionCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.