Class ValuePageWriter
- java.lang.Object
-
- org.apache.iotdb.tsfile.write.page.ValuePageWriter
-
public class ValuePageWriter extends java.lang.ObjectThis writer is used to write value into a page. It consists of a value encoder and respective OutputStream.
-
-
Constructor Summary
Constructors Constructor Description ValuePageWriter(Encoder valueEncoder, ICompressor compressor, TSDataType dataType)
-
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()intgetSize()Statistics<? extends java.io.Serializable>getStatistics()java.nio.ByteBuffergetUncompressedBytes()getUncompressedBytes return data what it has been written in form ofsize of time list, time list, value listvoidinitStatistics(TSDataType dataType)voidreset(TSDataType dataType)reset this pagevoidsetValueEncoder(Encoder encoder)voidwrite(long[] timestamps, boolean[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encodervoidwrite(long[] timestamps, double[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encodervoidwrite(long[] timestamps, float[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encodervoidwrite(long[] timestamps, int[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encodervoidwrite(long[] timestamps, long[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encodervoidwrite(long[] timestamps, Binary[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encodervoidwrite(long time, boolean value, boolean isNull)write a time value pair into encodervoidwrite(long time, double value, boolean isNull)write a time value pair into encodervoidwrite(long time, float value, boolean isNull)write a time value pair into encodervoidwrite(long time, int value, boolean isNull)write a time value pair into encodervoidwrite(long time, long value, boolean isNull)write a time value pair into encodervoidwrite(long time, short value, boolean isNull)write a time value pair into encodervoidwrite(long time, Binary value, boolean isNull)write a time value pair into encoderintwriteEmptyPageIntoBuff(PublicBAOS pageBuffer)intwritePageHeaderAndDataIntoBuff(PublicBAOS pageBuffer, boolean first)write the page header and data into the PageWriter's output stream.
-
-
-
Constructor Detail
-
ValuePageWriter
public ValuePageWriter(Encoder valueEncoder, ICompressor compressor, TSDataType dataType)
-
-
Method Detail
-
write
public void write(long time, boolean value, boolean isNull)write a time value pair into encoder
-
write
public void write(long time, short value, boolean isNull)write a time value pair into encoder
-
write
public void write(long time, int value, boolean isNull)write a time value pair into encoder
-
write
public void write(long time, long value, boolean isNull)write a time value pair into encoder
-
write
public void write(long time, float value, boolean isNull)write a time value pair into encoder
-
write
public void write(long time, double value, boolean isNull)write a time value pair into encoder
-
write
public void write(long time, Binary value, boolean isNull)write a time value pair into encoder
-
write
public void write(long[] timestamps, boolean[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encoder
-
write
public void write(long[] timestamps, int[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encoder
-
write
public void write(long[] timestamps, long[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encoder
-
write
public void write(long[] timestamps, float[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encoder
-
write
public void write(long[] timestamps, double[] values, boolean[] isNull, int batchSize, int arrayOffset)write time series into encoder
-
write
public void write(long[] timestamps, Binary[] values, boolean[] isNull, 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
-
writeEmptyPageIntoBuff
public int writeEmptyPageIntoBuff(PublicBAOS pageBuffer)
-
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(TSDataType dataType)
reset this page
-
setValueEncoder
public void setValueEncoder(Encoder encoder)
-
initStatistics
public void initStatistics(TSDataType dataType)
-
getPointNumber
public long getPointNumber()
-
getStatistics
public Statistics<? extends java.io.Serializable> getStatistics()
-
getSize
public int getSize()
-
-