public class RunLengthBitPackingHybridEncoder extends Object
rle-bit-packed-hybrid: <length> <encoded-data>
length := length of the <encoded-data> in bytes stored as 4 bytes little endian
encoded-data := <run>*
run := <bit-packed-run> | <rle-run>
bit-packed-run := <bit-packed-header> <bit-packed-values>
bit-packed-header := varint-encode(<bit-pack-count> << 1 | 1)
// we always bit-pack a multiple of 8 values at a time, so we only store the number of values / 8
bit-pack-count := (number of values in this run) / 8
bit-packed-values := bit packed back to back, from LSB to MSB
rle-run := <rle-header> <repeated-value>
rle-header := varint-encode( (number of times repeated) << 1)
repeated-value := value that is repeated, using a fixed-width of round-up-to-next-byte(bit-width)
NOTE: this class is only responsible for creating and returning the <encoded-data>
portion of the above grammar. The <length> portion is done by
RunLengthBitPackingHybridValuesWriter
Only supports positive values (including 0) // TODO: is that ok? Should we make a signed version?
| Constructor and Description |
|---|
RunLengthBitPackingHybridEncoder(int bitWidth,
int initialCapacity,
int pageSize,
ByteBufferAllocator allocator) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getAllocatedSize() |
long |
getBufferedSize() |
void |
reset()
Reset this encoder for re-use
|
BytesInput |
toBytes() |
void |
writeInt(int value) |
public RunLengthBitPackingHybridEncoder(int bitWidth,
int initialCapacity,
int pageSize,
ByteBufferAllocator allocator)
public void writeInt(int value)
throws IOException
IOExceptionpublic BytesInput toBytes() throws IOException
IOExceptionpublic void reset()
public void close()
public long getBufferedSize()
public long getAllocatedSize()
Copyright © 2019 The Apache Software Foundation. All rights reserved.