Class ValuePageWriter


  • public class ValuePageWriter
    extends java.lang.Object
    This writer is used to write value into a page. It consists of a value encoder and respective OutputStream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long estimateMaxMemSize()
      calculate max possible memory size it occupies, including time outputStream and value outputStream, because size outputStream is never used until flushing.
      long getPointNumber()  
      int getSize()  
      Statistics<? extends java.io.Serializable> getStatistics()  
      java.nio.ByteBuffer getUncompressedBytes()
      getUncompressedBytes return data what it has been written in form of size of time list, time list, value list
      void initStatistics​(TSDataType dataType)  
      void reset​(TSDataType dataType)
      reset this page
      void setValueEncoder​(Encoder encoder)  
      void write​(long[] timestamps, boolean[] values, boolean[] isNull, int batchSize, int arrayOffset)
      write time series into encoder
      void write​(long[] timestamps, double[] values, boolean[] isNull, int batchSize, int arrayOffset)
      write time series into encoder
      void write​(long[] timestamps, float[] values, boolean[] isNull, int batchSize, int arrayOffset)
      write time series into encoder
      void write​(long[] timestamps, int[] values, boolean[] isNull, int batchSize, int arrayOffset)
      write time series into encoder
      void write​(long[] timestamps, long[] values, boolean[] isNull, int batchSize, int arrayOffset)
      write time series into encoder
      void write​(long[] timestamps, Binary[] values, boolean[] isNull, int batchSize, int arrayOffset)
      write time series into encoder
      void write​(long time, boolean value, boolean isNull)
      write a time value pair into encoder
      void write​(long time, double value, boolean isNull)
      write a time value pair into encoder
      void write​(long time, float value, boolean isNull)
      write a time value pair into encoder
      void write​(long time, int value, boolean isNull)
      write a time value pair into encoder
      void write​(long time, long value, boolean isNull)
      write a time value pair into encoder
      void write​(long time, short value, boolean isNull)
      write a time value pair into encoder
      void write​(long time, Binary value, boolean isNull)
      write a time value pair into encoder
      int writeEmptyPageIntoBuff​(PublicBAOS pageBuffer)  
      int writePageHeaderAndDataIntoBuff​(PublicBAOS pageBuffer, boolean first)
      write the page header and data into the PageWriter's output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • write

        public void write​(long time,
                          boolean value,
                          boolean isNull)
        write a time value pair into encoder
      • write

        public void write​(long time,
                          short value,
                          boolean isNull)
        write a time value pair into encoder
      • write

        public void write​(long time,
                          int value,
                          boolean isNull)
        write a time value pair into encoder
      • write

        public void write​(long time,
                          long value,
                          boolean isNull)
        write a time value pair into encoder
      • write

        public void write​(long time,
                          float value,
                          boolean isNull)
        write a time value pair into encoder
      • write

        public void write​(long time,
                          double value,
                          boolean isNull)
        write a time value pair into encoder
      • write

        public void write​(long time,
                          Binary value,
                          boolean isNull)
        write a time value pair into encoder
      • write

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

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

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

        public void write​(long[] timestamps,
                          float[] values,
                          boolean[] isNull,
                          int batchSize,
                          int arrayOffset)
        write time series into encoder
      • write

        public void write​(long[] timestamps,
                          double[] values,
                          boolean[] isNull,
                          int batchSize,
                          int arrayOffset)
        write time series into encoder
      • write

        public void write​(long[] timestamps,
                          Binary[] values,
                          boolean[] isNull,
                          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
      • writeEmptyPageIntoBuff

        public int writeEmptyPageIntoBuff​(PublicBAOS pageBuffer)
      • 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​(TSDataType dataType)
        reset this page
      • setValueEncoder

        public void setValueEncoder​(Encoder encoder)
      • initStatistics

        public void initStatistics​(TSDataType dataType)
      • getPointNumber

        public long getPointNumber()
      • getStatistics

        public Statistics<? extends java.io.Serializable> getStatistics()
      • getSize

        public int getSize()