Class TimePageWriter
- java.lang.Object
-
- org.apache.iotdb.tsfile.write.page.TimePageWriter
-
public class TimePageWriter extends java.lang.ObjectThis writer is used to write time into a page. It consists of a time encoder and respective OutputStream.
-
-
Constructor Summary
Constructors Constructor Description TimePageWriter(Encoder timeEncoder, ICompressor compressor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longestimateMaxMemSize()calculate max possible memory size it occupies, including time outputStream and value outputStream, because size outputStream is never used until flushing.longgetPointNumber()TimeStatisticsgetStatistics()java.nio.ByteBuffergetUncompressedBytes()getUncompressedBytes return data what it has been written in form ofsize of time list, time list, value listvoidinitStatistics()voidreset()reset this pagevoidsetTimeEncoder(Encoder encoder)voidwrite(long time)write a time into encodervoidwrite(long[] timestamps, int batchSize, int arrayOffset)write time series into encoderintwritePageHeaderAndDataIntoBuff(PublicBAOS pageBuffer, boolean first)write the page header and data into the PageWriter's output stream.
-
-
-
Constructor Detail
-
TimePageWriter
public TimePageWriter(Encoder timeEncoder, ICompressor compressor)
-
-
Method Detail
-
write
public void write(long time)
write a time into encoder
-
write
public void write(long[] timestamps, int batchSize, int arrayOffset)write time series into encoder
-
getUncompressedBytes
public java.nio.ByteBuffer getUncompressedBytes() throws java.io.IOExceptiongetUncompressedBytes return data what it has been written in form ofsize of time list, time list, value list- Returns:
- a new readable ByteBuffer whose position is 0.
- Throws:
java.io.IOException
-
writePageHeaderAndDataIntoBuff
public int writePageHeaderAndDataIntoBuff(PublicBAOS pageBuffer, boolean first) throws java.io.IOException
write the page header and data into the PageWriter's output stream.- Throws:
java.io.IOException
-
estimateMaxMemSize
public long estimateMaxMemSize()
calculate max possible memory size it occupies, including time outputStream and value outputStream, because size outputStream is never used until flushing.- Returns:
- allocated size in time, value and outputStream
-
reset
public void reset()
reset this page
-
setTimeEncoder
public void setTimeEncoder(Encoder encoder)
-
initStatistics
public void initStatistics()
-
getPointNumber
public long getPointNumber()
-
getStatistics
public TimeStatistics getStatistics()
-
-