Class WritableMemChunk
- java.lang.Object
-
- org.apache.iotdb.db.engine.memtable.WritableMemChunk
-
- All Implemented Interfaces:
IWritableMemChunk,SerializedSize,WALEntryValue
public class WritableMemChunk extends java.lang.Object implements IWritableMemChunk
-
-
Constructor Summary
Constructors Constructor Description WritableMemChunk(org.apache.iotdb.tsfile.write.schema.IMeasurementSchema schema)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount()org.apache.iotdb.tsfile.write.chunk.IChunkWritercreateIChunkWriter()intdelete(long lowerBound, long upperBound)static WritableMemChunkdeserialize(java.io.DataInputStream stream)voidencode(org.apache.iotdb.tsfile.write.chunk.IChunkWriter chunkWriter)longgetFirstPoint()longgetLastPoint()longgetMinTime()org.apache.iotdb.tsfile.write.schema.IMeasurementSchemagetSchema()TVListgetSortedTvListForQuery()served for query requests.TVListgetSortedTvListForQuery(java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> measurementSchema)served for vector query requests.TVListgetTVList()voidputAlignedValue(long t, java.lang.Object[] v, int[] columnOrder)voidputAlignedValues(long[] t, java.lang.Object[] v, org.apache.iotdb.tsfile.utils.BitMap[] bitMaps, int[] columnOrder, int start, int end)voidputBinaries(long[] t, org.apache.iotdb.tsfile.utils.Binary[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)voidputBinary(long t, org.apache.iotdb.tsfile.utils.Binary v)voidputBoolean(long t, boolean v)voidputBooleans(long[] t, boolean[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)voidputDouble(long t, double v)voidputDoubles(long[] t, double[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)voidputFloat(long t, float v)voidputFloats(long[] t, float[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)voidputInt(long t, int v)voidputInts(long[] t, int[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)voidputLong(long t, long v)voidputLongs(long[] t, long[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)voidrelease()intserializedSize()Calculate size after serialization.voidserializeToWAL(IWALByteBufferView buffer)Serialize usingIWALByteBufferView, which encapsulates some actions to deal withBufferOverflowExceptionoccurs inByteBuffer.voidsortTvListForFlush()served for flush requests.java.lang.StringtoString()voidwrite(long[] times, java.lang.Object valueList, org.apache.iotdb.tsfile.utils.BitMap bitMap, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType, int start, int end)write data in the range [start, end).voidwrite(long insertTime, java.lang.Object objectValue)voidwriteAlignedValue(long insertTime, java.lang.Object[] objectValue, java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList)voidwriteAlignedValues(long[] times, java.lang.Object[] valueList, org.apache.iotdb.tsfile.utils.BitMap[] bitMaps, java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList, int start, int end)
-
-
-
Method Detail
-
write
public void write(long insertTime, java.lang.Object objectValue)- Specified by:
writein interfaceIWritableMemChunk
-
writeAlignedValue
public void writeAlignedValue(long insertTime, java.lang.Object[] objectValue, java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList)- Specified by:
writeAlignedValuein interfaceIWritableMemChunk
-
write
public void write(long[] times, java.lang.Object valueList, org.apache.iotdb.tsfile.utils.BitMap bitMap, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType, int start, int end)Description copied from interface:IWritableMemChunkwrite data in the range [start, end). Null value in the valueList will be replaced by the subsequent non-null value, e.g., {1, null, 3, null, 5} will be {1, 3, 5, null, 5}- Specified by:
writein interfaceIWritableMemChunk
-
writeAlignedValues
public void writeAlignedValues(long[] times, java.lang.Object[] valueList, org.apache.iotdb.tsfile.utils.BitMap[] bitMaps, java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList, int start, int end)- Specified by:
writeAlignedValuesin interfaceIWritableMemChunk
-
putLong
public void putLong(long t, long v)- Specified by:
putLongin interfaceIWritableMemChunk
-
putInt
public void putInt(long t, int v)- Specified by:
putIntin interfaceIWritableMemChunk
-
putFloat
public void putFloat(long t, float v)- Specified by:
putFloatin interfaceIWritableMemChunk
-
putDouble
public void putDouble(long t, double v)- Specified by:
putDoublein interfaceIWritableMemChunk
-
putBinary
public void putBinary(long t, org.apache.iotdb.tsfile.utils.Binary v)- Specified by:
putBinaryin interfaceIWritableMemChunk
-
putBoolean
public void putBoolean(long t, boolean v)- Specified by:
putBooleanin interfaceIWritableMemChunk
-
putAlignedValue
public void putAlignedValue(long t, java.lang.Object[] v, int[] columnOrder)- Specified by:
putAlignedValuein interfaceIWritableMemChunk
-
putLongs
public void putLongs(long[] t, long[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)- Specified by:
putLongsin interfaceIWritableMemChunk
-
putInts
public void putInts(long[] t, int[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)- Specified by:
putIntsin interfaceIWritableMemChunk
-
putFloats
public void putFloats(long[] t, float[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)- Specified by:
putFloatsin interfaceIWritableMemChunk
-
putDoubles
public void putDoubles(long[] t, double[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)- Specified by:
putDoublesin interfaceIWritableMemChunk
-
putBinaries
public void putBinaries(long[] t, org.apache.iotdb.tsfile.utils.Binary[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)- Specified by:
putBinariesin interfaceIWritableMemChunk
-
putBooleans
public void putBooleans(long[] t, boolean[] v, org.apache.iotdb.tsfile.utils.BitMap bitMap, int start, int end)- Specified by:
putBooleansin interfaceIWritableMemChunk
-
putAlignedValues
public void putAlignedValues(long[] t, java.lang.Object[] v, org.apache.iotdb.tsfile.utils.BitMap[] bitMaps, int[] columnOrder, int start, int end)- Specified by:
putAlignedValuesin interfaceIWritableMemChunk
-
getSortedTvListForQuery
public TVList getSortedTvListForQuery()
Description copied from interface:IWritableMemChunkserved for query requests.if tv list has been sorted, just return reference of it
if tv list hasn't been sorted and has no reference, sort and return reference of it
if tv list hasn't been sorted and has reference we should copy and sort it, then return ths list
the mechanism is just like copy on write
This interface should be synchronized for concurrent with sortTvListForFlush
- Specified by:
getSortedTvListForQueryin interfaceIWritableMemChunk- Returns:
- sorted tv list
-
getSortedTvListForQuery
public TVList getSortedTvListForQuery(java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> measurementSchema)
Description copied from interface:IWritableMemChunkserved for vector query requests.the mechanism is just like copy on write
This interface should be synchronized for concurrent with sortTvListForFlush
- Specified by:
getSortedTvListForQueryin interfaceIWritableMemChunk- Returns:
- sorted tv list
-
sortTvListForFlush
public void sortTvListForFlush()
Description copied from interface:IWritableMemChunkserved for flush requests. The logic is just same as getSortedTVListForQuery, but without add reference countThis interface should be synchronized for concurrent with getSortedTvListForQuery
- Specified by:
sortTvListForFlushin interfaceIWritableMemChunk
-
getTVList
public TVList getTVList()
- Specified by:
getTVListin interfaceIWritableMemChunk
-
count
public long count()
- Specified by:
countin interfaceIWritableMemChunk
-
getSchema
public org.apache.iotdb.tsfile.write.schema.IMeasurementSchema getSchema()
- Specified by:
getSchemain interfaceIWritableMemChunk
-
getMinTime
public long getMinTime()
- Specified by:
getMinTimein interfaceIWritableMemChunk
-
getFirstPoint
public long getFirstPoint()
- Specified by:
getFirstPointin interfaceIWritableMemChunk
-
getLastPoint
public long getLastPoint()
- Specified by:
getLastPointin interfaceIWritableMemChunk
-
delete
public int delete(long lowerBound, long upperBound)- Specified by:
deletein interfaceIWritableMemChunk- Returns:
- how many points are deleted
-
createIChunkWriter
public org.apache.iotdb.tsfile.write.chunk.IChunkWriter createIChunkWriter()
- Specified by:
createIChunkWriterin interfaceIWritableMemChunk
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
encode
public void encode(org.apache.iotdb.tsfile.write.chunk.IChunkWriter chunkWriter)
- Specified by:
encodein interfaceIWritableMemChunk
-
release
public void release()
- Specified by:
releasein interfaceIWritableMemChunk
-
serializedSize
public int serializedSize()
Description copied from interface:SerializedSizeCalculate size after serialization.- Specified by:
serializedSizein interfaceSerializedSize- Returns:
- bytes number
-
serializeToWAL
public void serializeToWAL(IWALByteBufferView buffer)
Description copied from interface:WALEntryValueSerialize usingIWALByteBufferView, which encapsulates some actions to deal withBufferOverflowExceptionoccurs inByteBuffer.- Specified by:
serializeToWALin interfaceWALEntryValue
-
deserialize
public static WritableMemChunk deserialize(java.io.DataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
-