Class TimePageWriter


  • public class TimePageWriter
    extends java.lang.Object
    This writer is used to write time into a page. It consists of a time encoder and respective OutputStream.
    • Constructor Detail

    • Method Detail

      • write

        public void write​(long time)
        write a time into encoder
      • write

        public void write​(long[] timestamps,
                          int batchSize,
                          int arrayOffset)
        write time series into encoder
      • getUncompressedBytes

        public java.nio.ByteBuffer getUncompressedBytes()
                                                 throws java.io.IOException
        getUncompressedBytes return data what it has been written in form of size of time list, time list, value list
        Returns:
        a new readable ByteBuffer whose position is 0.
        Throws:
        java.io.IOException
      • writePageHeaderAndDataIntoBuff

        public int writePageHeaderAndDataIntoBuff​(PublicBAOS pageBuffer,
                                                  boolean first)
                                           throws java.io.IOException
        write the page header and data into the PageWriter's output stream.
        Throws:
        java.io.IOException
      • estimateMaxMemSize

        public long estimateMaxMemSize()
        calculate max possible memory size it occupies, including time outputStream and value outputStream, because size outputStream is never used until flushing.
        Returns:
        allocated size in time, value and outputStream
      • reset

        public void reset()
        reset this page
      • setTimeEncoder

        public void setTimeEncoder​(Encoder encoder)
      • initStatistics

        public void initStatistics()
      • getPointNumber

        public long getPointNumber()