protected abstract class BlockIndexOutput.BlockWriter extends Object
The abstraction provides an interface to write and flush blocks. Subclasses must implement the encoding of the block header and the encoding of the block data.
Modifier | Constructor and Description |
---|---|
protected |
BlockIndexOutput.BlockWriter() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
compress()
Compress the data block
|
void |
flush()
Flush of pending data block to the output file.
|
protected int |
getMinimumBufferSize(int bufferSize,
int windowSize)
Compute the minimum size of a buffer based on the required size and
the compression window size.
|
protected abstract void |
initBlock()
Init writer for new block
|
abstract boolean |
isEmpty() |
abstract boolean |
isFull() |
protected void |
writeBlock()
Write data block to the output file with the following sequence of
operations:
Compress the data
Write block header (as header can depend on statistic computed
from data compression)
Write compressed data block
Reset writer for new block
|
protected abstract void |
writeData()
Write compressed data block to the output file
|
protected abstract void |
writeHeader()
Write block header to the output file
|
public void flush() throws IOException
IOException
protected void writeBlock() throws IOException
IOException
public abstract boolean isEmpty()
public abstract boolean isFull()
protected abstract void compress()
protected abstract void writeHeader() throws IOException
IOException
protected abstract void writeData() throws IOException
IOException
protected abstract void initBlock()
protected int getMinimumBufferSize(int bufferSize, int windowSize)
Copyright © 2014. All rights reserved.