Class AlignedChunkGroupWriterImpl

    • Constructor Detail

      • AlignedChunkGroupWriterImpl

        public AlignedChunkGroupWriterImpl​(java.lang.String deviceId)
    • Method Detail

      • tryToAddSeriesWriter

        public void tryToAddSeriesWriter​(MeasurementSchema measurementSchema)
                                  throws java.io.IOException
        Description copied from interface: IChunkGroupWriter
        given a measurement descriptor, create a corresponding writer and put into this ChunkGroupWriter.
        Specified by:
        tryToAddSeriesWriter in interface IChunkGroupWriter
        Parameters:
        measurementSchema - a measurement descriptor containing the message of the series
        Throws:
        java.io.IOException
      • tryToAddSeriesWriter

        public void tryToAddSeriesWriter​(java.util.List<MeasurementSchema> measurementSchemas)
                                  throws java.io.IOException
        Description copied from interface: IChunkGroupWriter
        given a measurement descriptor list, create corresponding writers and put into this ChunkGroupWriter.
        Specified by:
        tryToAddSeriesWriter in interface IChunkGroupWriter
        Throws:
        java.io.IOException
      • write

        public int write​(long time,
                         java.util.List<DataPoint> data)
                  throws WriteProcessException,
                         java.io.IOException
        Description copied from interface: IChunkGroupWriter
        receive a timestamp and a list of data points, write them to their series writers.
        Specified by:
        write in interface IChunkGroupWriter
        Parameters:
        time - - all data points have unify time stamp.
        data - - data point list to input
        Throws:
        WriteProcessException - exception in write process
        java.io.IOException - exception in IO
      • flushToFileWriter

        public long flushToFileWriter​(TsFileIOWriter tsfileWriter)
                               throws java.io.IOException
        Description copied from interface: IChunkGroupWriter
        flushing method for serializing to local file system or HDFS. Implemented by ChunkWriterImpl.writeToFileWriter().
        Specified by:
        flushToFileWriter in interface IChunkGroupWriter
        Parameters:
        tsfileWriter - - TSFileIOWriter
        Returns:
        current ChunkGroupDataSize
        Throws:
        java.io.IOException - exception in IO
      • updateMaxGroupMemSize

        public long updateMaxGroupMemSize()
        Description copied from interface: IChunkGroupWriter
        get the max memory occupied at this time. Note that, this method should be called after running long calcAllocatedSize()
        Specified by:
        updateMaxGroupMemSize in interface IChunkGroupWriter
        Returns:
        - allocated memory size.
      • getCurrentChunkGroupSize

        public long getCurrentChunkGroupSize()
        Description copied from interface: IChunkGroupWriter
        get the serialized size of current chunkGroup header + all chunks. Notice, the value does not include any un-sealed page in the chunks.
        Specified by:
        getCurrentChunkGroupSize in interface IChunkGroupWriter
        Returns:
        the serialized size of current chunkGroup header + all chunk
      • tryToAddEmptyPageAndData

        public void tryToAddEmptyPageAndData​(ValueChunkWriter valueChunkWriter)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • getMeasurements

        public java.util.List<java.lang.String> getMeasurements()
      • getLastTime

        public java.lang.Long getLastTime()
      • setLastTime

        public void setLastTime​(java.lang.Long lastTime)