public class RunLengthIntegerWriterV2 extends Object implements IntegerWriter
A writer that performs light weight compression over sequence of integers.
There are four types of lightweight integer compression
The description and format for these types are as below: SHORT_REPEAT: Used for short repeated integer sequences.
DIRECT: Used for random integer sequences whose number of bit requirement doesn't vary a lot.
PATCHED_BASE: Used for random integer sequences whose number of bit requirement varies beyond a threshold.
DELTA Used for monotonically increasing or decreasing sequences, sequences with fixed delta values or long repeated sequences.
Modifier and Type | Class and Description |
---|---|
static class |
RunLengthIntegerWriterV2.EncodingType |
Constructor and Description |
---|
RunLengthIntegerWriterV2(PositionedOutputStream output,
boolean signed,
boolean alignedBitpacking) |
Modifier and Type | Method and Description |
---|---|
void |
changeIv(Consumer<byte[]> modifier) |
long |
estimateMemory()
Estimate the amount of memory being used.
|
void |
flush()
Flush the buffer
|
void |
getPosition(PositionRecorder recorder)
Get position from the stream.
|
void |
write(long val)
Write the integer value
|
public RunLengthIntegerWriterV2(PositionedOutputStream output, boolean signed, boolean alignedBitpacking)
public void flush() throws IOException
IntegerWriter
flush
in interface IntegerWriter
IOException
public void write(long val) throws IOException
IntegerWriter
write
in interface IntegerWriter
IOException
public void getPosition(PositionRecorder recorder) throws IOException
IntegerWriter
getPosition
in interface IntegerWriter
IOException
public long estimateMemory()
IntegerWriter
estimateMemory
in interface IntegerWriter
public void changeIv(Consumer<byte[]> modifier)
changeIv
in interface IntegerWriter
Copyright © 2013–2021 The Apache Software Foundation. All rights reserved.