Interface IChunkGroupWriter
-
- All Known Implementing Classes:
AlignedChunkGroupWriterImpl,NonAlignedChunkGroupWriterImpl
public interface IChunkGroupWriterA chunk group in TsFile contains several series. A ChunkGroupWriter should implement write method which takes a timestamp(in TimeValue class) and a list of data points as input. It should also provide flushing method for serializing to local file system or HDFS.
-
-
Method Summary
All Methods Instance Methods Abstract 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.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
-
write
int write(long time, java.util.List<DataPoint> data) throws WriteProcessException, java.io.IOExceptionreceive a timestamp and a list of data points, write them to their series writers.- 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
int write(Tablet tablet) throws WriteProcessException, java.io.IOException
receive a tablet, write it to chunk writers- Throws:
WriteProcessException- exception in write processjava.io.IOException- exception in IO
-
flushToFileWriter
long flushToFileWriter(TsFileIOWriter tsfileWriter) throws java.io.IOException
flushing method for serializing to local file system or HDFS. Implemented by ChunkWriterImpl.writeToFileWriter().- Parameters:
tsfileWriter- - TSFileIOWriter- Returns:
- current ChunkGroupDataSize
- Throws:
java.io.IOException- exception in IO
-
updateMaxGroupMemSize
long updateMaxGroupMemSize()
get the max memory occupied at this time. Note that, this method should be called after runninglong calcAllocatedSize()- Returns:
- - allocated memory size.
-
tryToAddSeriesWriter
void tryToAddSeriesWriter(MeasurementSchema measurementSchema) throws java.io.IOException
given a measurement descriptor, create a corresponding writer and put into this ChunkGroupWriter.- Parameters:
measurementSchema- a measurement descriptor containing the message of the series- Throws:
java.io.IOException
-
tryToAddSeriesWriter
void tryToAddSeriesWriter(java.util.List<MeasurementSchema> measurementSchemas) throws java.io.IOException
given a measurement descriptor list, create corresponding writers and put into this ChunkGroupWriter.- Parameters:
measurementSchemas-- Throws:
java.io.IOException
-
getCurrentChunkGroupSize
long getCurrentChunkGroupSize()
get the serialized size of current chunkGroup header + all chunks. Notice, the value does not include any un-sealed page in the chunks.- Returns:
- the serialized size of current chunkGroup header + all chunk
-
-