public final class MonotonicBlockPackedWriter extends AbstractBlockPackedWriter
The sequence is divided into fixed-size blocks and for each block, values are modeled after a linear function f: x → A × x + B. The block encodes deltas from the expected values computed from this function using as few bits as possible.
Format:
zig-zag encoded
vLong
Float.floatToIntBits(float)
on
4 bytes
variable-length int
packed
deltas from the expected value
(computed from the function) using exaclty BitsPerValue bits per value.
MonotonicBlockPackedReader
blocks, BPV_SHIFT, finished, MAX_BLOCK_SIZE, MIN_BLOCK_SIZE, MIN_VALUE_EQUALS_0, off, ord, out, values
Constructor and Description |
---|
MonotonicBlockPackedWriter(DataOutput out,
int blockSize)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(long l)
Append a new long.
|
protected void |
flush() |
addBlockOfZeros, finish, ord, reset, writeValues, writeVLong
public MonotonicBlockPackedWriter(DataOutput out, int blockSize)
blockSize
- the number of values of a single block, must be a power of 2public void add(long l) throws java.io.IOException
AbstractBlockPackedWriter
add
in class AbstractBlockPackedWriter
java.io.IOException
protected void flush() throws java.io.IOException
flush
in class AbstractBlockPackedWriter
java.io.IOException