public class DocsFreqBlockIndexOutput.DocsFreqBlockWriter extends BlockIndexOutput.BlockWriter
BlockWriter for the .doc file.
Encode and write blocks containing the document identifiers and the node frequencies. It also encodes the pointers of the associated blocks from the .nod and .pos files into the block header.
This class must be associated to the Indexs of the
NodBlockIndexOutput.NodBlockWriter and PosBlockIndexOutput.PosBlockWriter using
#setNodeBlockIndex(Index) and #setPosBlockIndex(Index).
| Constructor and Description |
|---|
DocsFreqBlockIndexOutput.DocsFreqBlockWriter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
compress()
Compress the data block
|
int |
getFirstDocId() |
int |
getMaxBlockSize() |
protected void |
initBlock()
Init writer for new block
|
boolean |
isEmpty() |
boolean |
isFull() |
void |
setNodeBlockIndex(BlockIndexOutput.Index index)
Set the
Index of the NodBlockIndexOutput. |
void |
setPosBlockIndex(BlockIndexOutput.Index index)
Set the
Index of the PosBlockIndexOutput. |
void |
write(int docId)
Add a document identifier to the buffer.
|
protected void |
writeData()
Write compressed data block to the output file
|
protected void |
writeHeader()
Write block header to the output file
|
void |
writeNodeFreq(int nodeFreqInDoc)
Add a node frenquency to the buffer.
|
flush, getMinimumBufferSize, writeBlockpublic DocsFreqBlockIndexOutput.DocsFreqBlockWriter()
public int getMaxBlockSize()
public int getFirstDocId()
public void setNodeBlockIndex(BlockIndexOutput.Index index) throws IOException
Index of the NodBlockIndexOutput. The
Index is used to read the current file pointer of the
NodBlockIndexOutput when flushing a block.IOExceptionpublic void setPosBlockIndex(BlockIndexOutput.Index index) throws IOException
Index of the PosBlockIndexOutput. The
Index is used to read the current file pointer of the
PosBlockIndexOutput when flushing a block.IOExceptionpublic void write(int docId)
throws IOException
IOExceptionpublic void writeNodeFreq(int nodeFreqInDoc)
public boolean isEmpty()
isEmpty in class BlockIndexOutput.BlockWriterpublic boolean isFull()
isFull in class BlockIndexOutput.BlockWriterprotected void compress()
BlockIndexOutput.BlockWritercompress in class BlockIndexOutput.BlockWriterprotected void writeHeader()
throws IOException
BlockIndexOutput.BlockWriterwriteHeader in class BlockIndexOutput.BlockWriterIOExceptionprotected void writeData()
throws IOException
BlockIndexOutput.BlockWriterwriteData in class BlockIndexOutput.BlockWriterIOExceptionprotected void initBlock()
BlockIndexOutput.BlockWriterinitBlock in class BlockIndexOutput.BlockWriterCopyright © 2014. All rights reserved.