Class AlignedChunkGroupWriterImpl
- java.lang.Object
-
- org.apache.iotdb.tsfile.write.chunk.AlignedChunkGroupWriterImpl
-
- All Implemented Interfaces:
IChunkGroupWriter
public class AlignedChunkGroupWriterImpl extends java.lang.Object implements IChunkGroupWriter
-
-
Constructor Summary
Constructors Constructor Description AlignedChunkGroupWriterImpl(java.lang.String deviceId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longflushToFileWriter(TsFileIOWriter tsfileWriter)flushing method for serializing to local file system or HDFS.longgetCurrentChunkGroupSize()get the serialized size of current chunkGroup header + all chunks.java.lang.LonggetLastTime()java.util.List<java.lang.String>getMeasurements()voidsetLastTime(java.lang.Long lastTime)voidtryToAddEmptyPageAndData(ValueChunkWriter valueChunkWriter)voidtryToAddSeriesWriter(java.util.List<MeasurementSchema> measurementSchemas)given a measurement descriptor list, create corresponding writers and put into this ChunkGroupWriter.voidtryToAddSeriesWriter(MeasurementSchema measurementSchema)given a measurement descriptor, create a corresponding writer and put into this ChunkGroupWriter.longupdateMaxGroupMemSize()get the max memory occupied at this time.intwrite(long time, java.util.List<DataPoint> data)receive a timestamp and a list of data points, write them to their series writers.intwrite(Tablet tablet)receive a tablet, write it to chunk writers
-
-
-
Method Detail
-
tryToAddSeriesWriter
public void tryToAddSeriesWriter(MeasurementSchema measurementSchema) throws java.io.IOException
Description copied from interface:IChunkGroupWritergiven a measurement descriptor, create a corresponding writer and put into this ChunkGroupWriter.- Specified by:
tryToAddSeriesWriterin interfaceIChunkGroupWriter- 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:IChunkGroupWritergiven a measurement descriptor list, create corresponding writers and put into this ChunkGroupWriter.- Specified by:
tryToAddSeriesWriterin interfaceIChunkGroupWriter- Throws:
java.io.IOException
-
write
public int write(long time, java.util.List<DataPoint> data) throws WriteProcessException, java.io.IOExceptionDescription copied from interface:IChunkGroupWriterreceive a timestamp and a list of data points, write them to their series writers.- Specified by:
writein interfaceIChunkGroupWriter- Parameters:
time- - all data points have unify time stamp.data- - data point list to input- Throws:
WriteProcessException- exception in write processjava.io.IOException- exception in IO
-
write
public int write(Tablet tablet) throws WriteProcessException, java.io.IOException
Description copied from interface:IChunkGroupWriterreceive a tablet, write it to chunk writers- Specified by:
writein interfaceIChunkGroupWriter- Throws:
WriteProcessException- exception in write processjava.io.IOException- exception in IO
-
flushToFileWriter
public long flushToFileWriter(TsFileIOWriter tsfileWriter) throws java.io.IOException
Description copied from interface:IChunkGroupWriterflushing method for serializing to local file system or HDFS. Implemented by ChunkWriterImpl.writeToFileWriter().- Specified by:
flushToFileWriterin interfaceIChunkGroupWriter- Parameters:
tsfileWriter- - TSFileIOWriter- Returns:
- current ChunkGroupDataSize
- Throws:
java.io.IOException- exception in IO
-
updateMaxGroupMemSize
public long updateMaxGroupMemSize()
Description copied from interface:IChunkGroupWriterget the max memory occupied at this time. Note that, this method should be called after runninglong calcAllocatedSize()- Specified by:
updateMaxGroupMemSizein interfaceIChunkGroupWriter- Returns:
- - allocated memory size.
-
getCurrentChunkGroupSize
public long getCurrentChunkGroupSize()
Description copied from interface:IChunkGroupWriterget the serialized size of current chunkGroup header + all chunks. Notice, the value does not include any un-sealed page in the chunks.- Specified by:
getCurrentChunkGroupSizein interfaceIChunkGroupWriter- 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)
-
-