Class IntRleEncoder
- java.lang.Object
-
- org.apache.iotdb.tsfile.encoding.encoder.Encoder
-
- org.apache.iotdb.tsfile.encoding.encoder.RleEncoder<java.lang.Integer>
-
- org.apache.iotdb.tsfile.encoding.encoder.IntRleEncoder
-
public class IntRleEncoder extends RleEncoder<java.lang.Integer>
Encoder for int value using rle or bit-packing.
-
-
Field Summary
-
Fields inherited from class org.apache.iotdb.tsfile.encoding.encoder.RleEncoder
bitPackedGroupCount, bitWidth, bufferedValues, byteCache, bytesBuffer, config, isBitPackRun, isBitWidthSaved, numBufferedValues, preValue, repeatCount, values
-
Fields inherited from class org.apache.iotdb.tsfile.encoding.encoder.Encoder
MAX_POINT_NUMBER, MAX_STRING_LENGTH
-
-
Constructor Summary
Constructors Constructor Description IntRleEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclearBuffer()clean all useless value in bufferedValues and set 0.protected voidconvertBuffer()voidencode(boolean value, java.io.ByteArrayOutputStream out)voidencode(int value, java.io.ByteArrayOutputStream out)voidflush(java.io.ByteArrayOutputStream out)write all values buffered in the cache to an OutputStream.longgetMaxByteSize()The maximal possible memory size occupied by current Encoder.intgetOneItemMaxSize()When encoder accepts a new incoming data point, the maximal possible size in byte it takes to store in memory.protected voidreset()protected voidwriteRleRun()write bytes to an outputStream using rle format: [header][value].-
Methods inherited from class org.apache.iotdb.tsfile.encoding.encoder.RleEncoder
encode, encode, encode, encode, encode, encode, encodeValue, endPreviousBitPackedRun, writeOrAppendBitPackedRun
-
-
-
-
Method Detail
-
encode
public void encode(int value, java.io.ByteArrayOutputStream out)- Overrides:
encodein classRleEncoder<java.lang.Integer>
-
encode
public void encode(boolean value, java.io.ByteArrayOutputStream out)- Overrides:
encodein classRleEncoder<java.lang.Integer>
-
flush
public void flush(java.io.ByteArrayOutputStream out) throws java.io.IOExceptionwrite all values buffered in the cache to an OutputStream.- Overrides:
flushin classRleEncoder<java.lang.Integer>- Parameters:
out- - byteArrayOutputStream- Throws:
java.io.IOException- cannot flush to OutputStream
-
reset
protected void reset()
- Overrides:
resetin classRleEncoder<java.lang.Integer>
-
writeRleRun
protected void writeRleRun() throws java.io.IOExceptionwrite bytes to an outputStream using rle format: [header][value].- Specified by:
writeRleRunin classRleEncoder<java.lang.Integer>- Throws:
java.io.IOException- cannot write RLE run
-
clearBuffer
protected void clearBuffer()
Description copied from class:RleEncoderclean all useless value in bufferedValues and set 0.- Specified by:
clearBufferin classRleEncoder<java.lang.Integer>
-
convertBuffer
protected void convertBuffer()
- Specified by:
convertBufferin classRleEncoder<java.lang.Integer>
-
getOneItemMaxSize
public int getOneItemMaxSize()
Description copied from class:EncoderWhen encoder accepts a new incoming data point, the maximal possible size in byte it takes to store in memory.- Overrides:
getOneItemMaxSizein classEncoder- Returns:
- the maximal possible size of one data item encoded by this encoder
-
getMaxByteSize
public long getMaxByteSize()
Description copied from class:EncoderThe maximal possible memory size occupied by current Encoder. This statistic value doesn't involve OutputStream.- Overrides:
getMaxByteSizein classEncoder- Returns:
- the maximal size of possible memory occupied by current encoder
-
-