Class FloatRLBE
- java.lang.Object
-
- org.apache.iotdb.tsfile.encoding.encoder.Encoder
-
- org.apache.iotdb.tsfile.encoding.encoder.RLBE
-
- org.apache.iotdb.tsfile.encoding.encoder.FloatRLBE
-
public class FloatRLBE extends RLBE
-
-
Field Summary
-
Fields inherited from class org.apache.iotdb.tsfile.encoding.encoder.RLBE
BLOCK_DEFAULT_SIZE, blockSize, byteBuffer, LengthCode, logger, numberLeftInBuffer, out, writeIndex
-
Fields inherited from class org.apache.iotdb.tsfile.encoding.encoder.Encoder
MAX_POINT_NUMBER, MAX_STRING_LENGTH
-
-
Constructor Summary
Constructors Constructor Description FloatRLBE()constructor of FloatRLBE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcalcFibonacci(int val)calculate fibonacci code of input integerprotected voidclearBuffer(java.io.ByteArrayOutputStream out)flush bits left in byteBuffer to output streamvoidencode(float value, java.io.ByteArrayOutputStream out)voidencodeValue(float value, java.io.ByteArrayOutputStream out)encode one input float valuevoidflush(java.io.ByteArrayOutputStream out)Write all values buffered in memory cache to OutputStream.protected voidflushBlock(java.io.ByteArrayOutputStream out)flush all encoded values in a block to output streamlonggetMaxByteSize()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 voidwriteBit(boolean b, java.io.ByteArrayOutputStream out)write one bit to byteBuffer, when byteBuffer is full, flush byteBuffer to output stream
-
-
-
Method Detail
-
reset
protected void reset()
-
encodeValue
public void encodeValue(float value, java.io.ByteArrayOutputStream out)encode one input float value- Parameters:
value- the float to be encodedout- the output stream to flush in when buffer is full
-
encode
public void encode(float value, java.io.ByteArrayOutputStream out)
-
flush
public void flush(java.io.ByteArrayOutputStream out)
Description copied from class:EncoderWrite all values buffered in memory cache to OutputStream.
-
calcFibonacci
protected int calcFibonacci(int val)
calculate fibonacci code of input integer- Parameters:
val- the integer to be fibonacci-encoded- Returns:
- the reverse fibonacci code of val in binary code
-
flushBlock
protected void flushBlock(java.io.ByteArrayOutputStream out)
flush all encoded values in a block to output stream- Parameters:
out- the output stream to be flushed to
-
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
-
writeBit
protected void writeBit(boolean b, java.io.ByteArrayOutputStream out)write one bit to byteBuffer, when byteBuffer is full, flush byteBuffer to output stream- Parameters:
b- the bit to be writtenout- output stream
-
clearBuffer
protected void clearBuffer(java.io.ByteArrayOutputStream out)
flush bits left in byteBuffer to output stream- Parameters:
out- output stream
-
-