Class LongRleEncoder
- java.lang.Object
-
- org.apache.iotdb.tsfile.encoding.encoder.Encoder
-
- org.apache.iotdb.tsfile.encoding.encoder.RleEncoder<java.lang.Long>
-
- org.apache.iotdb.tsfile.encoding.encoder.LongRleEncoder
-
public class LongRleEncoder extends RleEncoder<java.lang.Long>
Encoder for long 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 LongRleEncoder()Constructor of LongRleEncoder.
-
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(long value, java.io.ByteArrayOutputStream out)voidflush(java.io.ByteArrayOutputStream out)write all values buffered in cache to 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 OutputStream using rle rle format: [header][value].-
Methods inherited from class org.apache.iotdb.tsfile.encoding.encoder.RleEncoder
encode, encode, encode, encode, encode, encode, encode, encodeValue, endPreviousBitPackedRun, writeOrAppendBitPackedRun
-
-
-
-
Method Detail
-
encode
public void encode(long value, java.io.ByteArrayOutputStream out)- Overrides:
encodein classRleEncoder<java.lang.Long>
-
flush
public void flush(java.io.ByteArrayOutputStream out) throws java.io.IOExceptionwrite all values buffered in cache to OutputStream.- Overrides:
flushin classRleEncoder<java.lang.Long>- Parameters:
out- - byteArrayOutputStream- Throws:
java.io.IOException- cannot flush to OutputStream
-
reset
protected void reset()
- Overrides:
resetin classRleEncoder<java.lang.Long>
-
writeRleRun
protected void writeRleRun() throws java.io.IOExceptionwrite bytes to OutputStream using rle rle format: [header][value].- Specified by:
writeRleRunin classRleEncoder<java.lang.Long>- 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.Long>
-
convertBuffer
protected void convertBuffer()
- Specified by:
convertBufferin classRleEncoder<java.lang.Long>
-
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
-
-