Class NonAlignedChunkGroupWriterImpl

  • All Implemented Interfaces:
    IChunkGroupWriter

    public class NonAlignedChunkGroupWriterImpl
    extends java.lang.Object
    implements IChunkGroupWriter
    a implementation of IChunkGroupWriter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long flushToFileWriter​(TsFileIOWriter fileWriter)
      flushing method for serializing to local file system or HDFS.
      long getCurrentChunkGroupSize()
      get the serialized size of current chunkGroup header + all chunks.
      java.util.Map<java.lang.String,​java.lang.Long> getLastTimeMap()  
      void setLastTimeMap​(java.util.Map<java.lang.String,​java.lang.Long> lastTimeMap)  
      void tryToAddSeriesWriter​(java.util.List<MeasurementSchema> schemas)
      given a measurement descriptor list, create corresponding writers and put into this ChunkGroupWriter.
      void tryToAddSeriesWriter​(MeasurementSchema schema)
      given a measurement descriptor, create a corresponding writer and put into this ChunkGroupWriter.
      long updateMaxGroupMemSize()
      get the max memory occupied at this time.
      int write​(long time, java.util.List<DataPoint> data)
      receive a timestamp and a list of data points, write them to their series writers.
      int write​(Tablet tablet)
      receive a tablet, write it to chunk writers
      • Methods inherited from class java.lang.Object

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

      • NonAlignedChunkGroupWriterImpl

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

      • tryToAddSeriesWriter

        public void tryToAddSeriesWriter​(MeasurementSchema schema)
        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:
        schema - a measurement descriptor containing the message of the series
      • write

        public int write​(long time,
                         java.util.List<DataPoint> data)
                  throws java.io.IOException,
                         WriteProcessException
        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:
        java.io.IOException - exception in IO
        WriteProcessException - exception in write process
      • flushToFileWriter

        public long flushToFileWriter​(TsFileIOWriter fileWriter)
                               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:
        fileWriter - - 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
      • getLastTimeMap

        public java.util.Map<java.lang.String,​java.lang.Long> getLastTimeMap()
      • setLastTimeMap

        public void setLastTimeMap​(java.util.Map<java.lang.String,​java.lang.Long> lastTimeMap)