Class GorillaEncoderV2
- java.lang.Object
-
- org.apache.iotdb.tsfile.encoding.encoder.Encoder
-
- org.apache.iotdb.tsfile.encoding.encoder.GorillaEncoderV2
-
- Direct Known Subclasses:
IntChimpEncoder,IntGorillaEncoder,LongChimpEncoder,LongGorillaEncoder
public abstract class GorillaEncoderV2 extends Encoder
This class includes code modified from Michael Burman's gorilla-tsc project.Copyright: 2016-2018 Michael Burman and/or other contributors
Project page: https://github.com/burmanm/gorilla-tsc
License: http://www.apache.org/licenses/LICENSE-2.0
-
-
Field Summary
Fields Modifier and Type Field Description protected intbitsLeftprotected booleanfirstValueWasWrittenprotected intstoredLeadingZerosprotected intstoredTrailingZeros-
Fields inherited from class org.apache.iotdb.tsfile.encoding.encoder.Encoder
MAX_POINT_NUMBER, MAX_STRING_LENGTH
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGorillaEncoderV2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidflipByte(java.io.ByteArrayOutputStream out)longgetMaxByteSize()The maximal possible memory size occupied by current Encoder.protected voidreset()protected voidskipBit(java.io.ByteArrayOutputStream out)Stores a 0 and increases the count of bits by 1.protected voidwriteBit(java.io.ByteArrayOutputStream out)Stores a 1 and increases the count of bits by 1.protected voidwriteBits(long value, int bits, java.io.ByteArrayOutputStream out)Writes the given long value using the defined amount of least significant bits.
-
-
-
Method Detail
-
getMaxByteSize
public final 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
-
reset
protected void reset()
-
skipBit
protected void skipBit(java.io.ByteArrayOutputStream out)
Stores a 0 and increases the count of bits by 1.
-
writeBit
protected void writeBit(java.io.ByteArrayOutputStream out)
Stores a 1 and increases the count of bits by 1.
-
writeBits
protected void writeBits(long value, int bits, java.io.ByteArrayOutputStream out)Writes the given long value using the defined amount of least significant bits.- Parameters:
value- The long value to be writtenbits- How many bits are stored to the stream
-
flipByte
protected void flipByte(java.io.ByteArrayOutputStream out)
-
-