Class ChunkReader

    • Field Detail

      • filter

        protected Filter filter
    • Constructor Detail

      • ChunkReader

        public ChunkReader​(Chunk chunk,
                           Filter filter)
                    throws java.io.IOException
        constructor of ChunkReader.
        Parameters:
        chunk - input Chunk object
        filter - filter
        Throws:
        java.io.IOException
      • ChunkReader

        public ChunkReader​(Chunk chunk,
                           Filter filter,
                           long currentTimestamp)
                    throws java.io.IOException
        Constructor of ChunkReader by timestamp. This constructor is used to accelerate queries by filtering out pages whose endTime is less than current timestamp.
        Throws:
        java.io.IOException
      • ChunkReader

        public ChunkReader​(Chunk chunk)
        Constructor of ChunkReader without deserializing chunk into page. This is used for fast compaction.
    • Method Detail

      • hasNextSatisfiedPage

        public boolean hasNextSatisfiedPage()
        judge if has next page whose page header satisfies the filter.
        Specified by:
        hasNextSatisfiedPage in interface IChunkReader
      • nextPageData

        public BatchData nextPageData()
                               throws java.io.IOException
        get next data batch.
        Specified by:
        nextPageData in interface IChunkReader
        Returns:
        next data batch
        Throws:
        java.io.IOException - IOException
      • pageSatisfied

        protected boolean pageSatisfied​(PageHeader pageHeader)
      • readPageDataWithoutUncompressing

        public java.nio.ByteBuffer readPageDataWithoutUncompressing​(PageHeader pageHeader)
                                                             throws java.io.IOException
        Read page data without uncompressing it.
        Returns:
        compressed page data
        Throws:
        java.io.IOException
      • readPageData

        public TsBlock readPageData​(PageHeader pageHeader,
                                    java.nio.ByteBuffer compressedPageData)
                             throws java.io.IOException
        Read data from compressed page data. Uncompress the page and decode it to batch data.
        Parameters:
        compressedPageData - Compressed page data
        Throws:
        java.io.IOException