Class ChunkHeader


  • public class ChunkHeader
    extends Object
    • Method Detail

      • getSerializedSize

        public static int getSerializedSize​(String measurementID,
                                            int dataSize)
        the exact serialized size of chunk header.
      • getSerializedSize

        public static int getSerializedSize​(String measurementID)
        The estimated serialized size of chunk header. Only used when we don't know the actual dataSize attribute
      • getSerializedSize

        public int getSerializedSize()
      • deserializeFrom

        public static ChunkHeader deserializeFrom​(InputStream inputStream,
                                                  byte chunkType)
                                           throws IOException
        deserialize from inputStream, the marker has already been read.
        Returns:
        ChunkHeader the ChunkHeader read from inputStream
        Throws:
        IOException - exception when reading stream
      • deserializeFrom

        public static ChunkHeader deserializeFrom​(TsFileInput input,
                                                  long offset,
                                                  int chunkHeaderSize)
                                           throws IOException
        deserialize from TsFileInput, the marker has not been read.
        Parameters:
        input - TsFileInput
        offset - offset
        chunkHeaderSize - the estimated size of chunk's header
        Returns:
        CHUNK_HEADER object
        Throws:
        IOException - IOException
      • getMeasurementID

        public String getMeasurementID()
      • getDataSize

        public int getDataSize()
      • serializeTo

        public int serializeTo​(OutputStream outputStream)
                        throws IOException
        serialize to outputStream.
        Parameters:
        outputStream - outputStream
        Returns:
        length
        Throws:
        IOException - IOException
      • serializeTo

        public int serializeTo​(ByteBuffer buffer)
        serialize to ByteBuffer.
        Parameters:
        buffer - ByteBuffer
        Returns:
        length
      • getNumOfPages

        public int getNumOfPages()
      • getEncodingType

        public TSEncoding getEncodingType()
      • mergeChunkHeader

        public void mergeChunkHeader​(ChunkHeader chunkHeader)
      • setDataSize

        public void setDataSize​(int dataSize)
      • getChunkType

        public byte getChunkType()
      • setChunkType

        public void setChunkType​(byte chunkType)
      • increasePageNums

        public void increasePageNums​(int i)