Class NonAlignedChunkGroupWriterImpl
- java.lang.Object
-
- org.apache.iotdb.tsfile.write.chunk.NonAlignedChunkGroupWriterImpl
-
- All Implemented Interfaces:
IChunkGroupWriter
public class NonAlignedChunkGroupWriterImpl extends java.lang.Object implements IChunkGroupWriter
a implementation of IChunkGroupWriter.
-
-
Constructor Summary
Constructors Constructor Description NonAlignedChunkGroupWriterImpl(java.lang.String deviceId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longflushToFileWriter(TsFileIOWriter fileWriter)flushing method for serializing to local file system or HDFS.longgetCurrentChunkGroupSize()get the serialized size of current chunkGroup header + all chunks.java.util.Map<java.lang.String,java.lang.Long>getLastTimeMap()voidsetLastTimeMap(java.util.Map<java.lang.String,java.lang.Long> lastTimeMap)voidtryToAddSeriesWriter(java.util.List<MeasurementSchema> schemas)given a measurement descriptor list, create corresponding writers and put into this ChunkGroupWriter.voidtryToAddSeriesWriter(MeasurementSchema schema)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 schema)
Description copied from interface:IChunkGroupWritergiven a measurement descriptor, create a corresponding writer and put into this ChunkGroupWriter.- Specified by:
tryToAddSeriesWriterin interfaceIChunkGroupWriter- Parameters:
schema- a measurement descriptor containing the message of the series
-
tryToAddSeriesWriter
public void tryToAddSeriesWriter(java.util.List<MeasurementSchema> schemas)
Description copied from interface:IChunkGroupWritergiven a measurement descriptor list, create corresponding writers and put into this ChunkGroupWriter.- Specified by:
tryToAddSeriesWriterin interfaceIChunkGroupWriter
-
write
public int write(long time, java.util.List<DataPoint> data) throws java.io.IOException, WriteProcessExceptionDescription 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:
java.io.IOException- exception in IOWriteProcessException- exception in write process
-
write
public int write(Tablet tablet) throws WriteProcessException
Description copied from interface:IChunkGroupWriterreceive a tablet, write it to chunk writers- Specified by:
writein interfaceIChunkGroupWriter- Throws:
WriteProcessException- exception in write process
-
flushToFileWriter
public long flushToFileWriter(TsFileIOWriter fileWriter) 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:
fileWriter- - 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
-
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)
-
-