public class VIntBlockCompressor extends BlockCompressor
BlockCompressor based on the Variable Integer
encoding algorithm.| Modifier and Type | Field and Description |
|---|---|
protected int |
HEADER_SIZE
Size of header in buffer
|
| Constructor and Description |
|---|
VIntBlockCompressor() |
| Modifier and Type | Method and Description |
|---|---|
void |
compress(org.apache.lucene.util.IntsRef input,
org.apache.lucene.util.BytesRef output)
Compress the uncompressed data into the buffer using variable integer
encoding technique.
|
int |
getWindowSize()
Return the window size over the
IntsRef input buffer used during
compression. |
int |
maxCompressedSize(int arraySize)
The maximum size in bytes of a compressed block of values
|
protected final int HEADER_SIZE
public void compress(org.apache.lucene.util.IntsRef input,
org.apache.lucene.util.BytesRef output)
No header is stored.
compress in class BlockCompressorpublic int maxCompressedSize(int arraySize)
BlockCompressormaxCompressedSize in class BlockCompressorpublic int getWindowSize()
BlockCompressorIntsRef input buffer used during
compression.
This is to avoid ArrayIndexOutOfBoundsException if the compressor
is working on a buffer which size does not match a multiple of the window
size.
For example, AForBlockCompressor is performing compression using
a window of 32 integers. In the case of short postings list with
5 integers, the instantiated input buffer must be a multiple of window
size, i.e., 32 in this case. If the postings list would contain 33 integers
instead, then the instantiated input buffer should be 64.
getWindowSize in class BlockCompressorCopyright © 2014. All rights reserved.