public class BitmapEncoder extends Encoder
bitmap-encoding: <length> <num> <encoded-data>
length := length of the <encoded-data> in bytes stored as unsigned var int
num := number for all encoded data in <encoded-data> stored as unsigned var int
encoded-data := <run>*
run := <value> <bit-index>
value := value in the data after deduplication. Use varint-encode and store as unsigned var int
bit-index := a list of 01 sequence to record the position of the value above
.
Decode switch or enum values using bitmap, bitmap-encode.<length> <num> <encoded data>
MAX_POINT_NUMBER, MAX_STRING_LENGTH| Constructor and Description |
|---|
BitmapEncoder()
BitmapEncoder constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(int value,
ByteArrayOutputStream out)
Each time encoder receives a value, encoder doesn't write it to OutputStream immediately.
|
void |
flush(ByteArrayOutputStream out)
When all data received, encoder now encodes values in list and write them to OutputStream.
|
long |
getMaxByteSize()
The maximal possible memory size occupied by current Encoder.
|
int |
getOneItemMaxSize()
When encoder accepts a new incoming data point, the maximal possible size in byte it takes to
store in memory.
|
public void encode(int value,
ByteArrayOutputStream out)
encode in class Encodervalue - value to encodeout - OutputStream to write encoded streamIOException - cannot encode valueEncoder.encode(int, java.io.ByteArrayOutputStream)public void flush(ByteArrayOutputStream out) throws IOException
flush in class Encoderout - OutputStream to write encoded streamIOException - cannot flush to OutputStreamEncoder.flush(java.io.ByteArrayOutputStream)public int getOneItemMaxSize()
EncodergetOneItemMaxSize in class Encoderpublic long getMaxByteSize()
EncodergetMaxByteSize in class EncoderCopyright © 2022 The Apache Software Foundation. All rights reserved.