Class AlignedTVList
- java.lang.Object
-
- org.apache.iotdb.db.utils.datastructure.TVList
-
- org.apache.iotdb.db.utils.datastructure.AlignedTVList
-
- All Implemented Interfaces:
SerializedSize,WALEntryValue
public class AlignedTVList extends TVList
-
-
Field Summary
-
Fields inherited from class org.apache.iotdb.db.utils.datastructure.TVList
ERR_DATATYPE_NOT_CONSISTENT, minTime, pivotTime, referenceCount, rowCount, SMALL_ARRAY_LENGTH, sorted, sortedTimestamps, timestamps
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static longalignedTvListArrayMemCost(org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] types)Get the single alignedTVList array mem cost by give types.org.apache.iotdb.tsfile.read.common.block.TsBlockbuildTsBlock(int floatPrecision, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodingList, java.util.List<java.util.List<org.apache.iotdb.tsfile.read.common.TimeRange>> deletionList)Build TsBlock by column.voidclear()AlignedTVListclone()intdelete(long lowerBound, long upperBound)org.apache.iotdb.tsfile.utils.Pair<java.lang.Integer,java.lang.Boolean>delete(long lowerBound, long upperBound, int columnIndex)Delete points in a specific column.voiddeleteColumn(int columnIndex)static AlignedTVListdeserialize(java.io.DataInputStream stream)protected voidexpandValues()voidextendColumn(org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType)java.lang.ObjectgetAlignedValue(int index)org.apache.iotdb.tsfile.utils.BinarygetBinaryByValueIndex(int rowIndex, int columnIndex)Get the Binary value at the given position in VectorTvList.booleangetBooleanByValueIndex(int rowIndex, int columnIndex)Get the boolean value at the given position in VectorTvList.org.apache.iotdb.tsfile.file.metadata.enums.TSDataTypegetDataType()doublegetDoubleByValueIndex(int rowIndex, int columnIndex)Get the double value at the given position in VectorTvList.floatgetFloatByValueIndex(int rowIndex, int columnIndex)Get the float value at the given position in VectorTvList.intgetIntByValueIndex(int rowIndex, int columnIndex)Get the int value at the given position in AlignedTvList.longgetLongByValueIndex(int rowIndex, int columnIndex)Get the long value at the given position in VectorTvList.org.apache.iotdb.tsfile.read.TimeValuePairgetTimeValuePair(int index)for logprotected org.apache.iotdb.tsfile.read.TimeValuePairgetTimeValuePair(int index, long time, java.lang.Integer floatPrecision, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodingList)protected org.apache.iotdb.tsfile.read.TimeValuePairgetTimeValuePair(int index, long time, java.lang.Integer floatPrecision, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding)java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>getTsDataTypes()TVListgetTvListByColumnIndex(java.util.List<java.lang.Integer> columnIndex, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypeList)intgetValidRowIndexForTimeDuplicatedRows(java.util.List<java.lang.Integer> timeDuplicatedOriginRowIndexList, int columnIndex)Get the valid original row index in a column by a given time duplicated original row index list.intgetValueIndex(int index)Get the row index value in index columnjava.util.List<java.util.List<java.lang.Object>>getValues()booleanisNullValue(int rowIndex, int columnIndex)Get whether value is null at the given position in AlignedTvList.static AlignedTVListnewAlignedList(java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypes)voidputAlignedValue(long timestamp, java.lang.Object[] value, int[] columnIndexArray)voidputAlignedValues(long[] time, java.lang.Object[] value, org.apache.iotdb.tsfile.utils.BitMap[] bitMaps, int[] columnIndexArray, int start, int end)protected voidreleaseLastValueArray()protected voidreverseRange(int lo, int hi)protected voidsaveAsPivot(int pos)intserializedSize()Calculate size after serialization.voidserializeToWAL(IWALByteBufferView buffer)Serialize usingIWALByteBufferView, which encapsulates some actions to deal withBufferOverflowExceptionoccurs inByteBuffer.protected voidset(int src, int dest)protected voidsetFromSorted(int src, int dest)protected voidsetPivotTo(int pos)protected voidsetToSorted(int src, int dest)voidsort()protected voidwriteValidValuesIntoTsBlock(org.apache.iotdb.tsfile.read.common.block.TsBlockBuilder builder, int floatPrecision, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding, java.util.List<org.apache.iotdb.tsfile.read.common.TimeRange> deletionList)-
Methods inherited from class org.apache.iotdb.db.utils.datastructure.TVList
binarySort, buildTsBlock, buildTsBlock, checkExpansion, clearSortedTime, clearTime, clone, cloneAs, cloneTime, compare, countRunAndMakeAscending, getBinary, getBoolean, getDouble, getFloat, getInt, getLong, getMinTime, getPrimitiveArraysByType, getReferenceCount, getTime, getVersion, increaseReferenceCount, isPointDeleted, isSorted, merge, newList, putBinaries, putBinary, putBoolean, putBooleans, putDouble, putDoubles, putFloat, putFloats, putInt, putInts, putLong, putLongs, releaseLastTimeArray, roundValueWithGivenPrecision, roundValueWithGivenPrecision, rowCount, sort, tvListArrayMemCost
-
-
-
-
Method Detail
-
newAlignedList
public static AlignedTVList newAlignedList(java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypes)
-
putAlignedValue
public void putAlignedValue(long timestamp, java.lang.Object[] value, int[] columnIndexArray)- Overrides:
putAlignedValuein classTVList
-
getAlignedValue
public java.lang.Object getAlignedValue(int index)
- Overrides:
getAlignedValuein classTVList
-
getTimeValuePair
protected org.apache.iotdb.tsfile.read.TimeValuePair getTimeValuePair(int index, long time, java.lang.Integer floatPrecision, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding)- Specified by:
getTimeValuePairin classTVList
-
getTvListByColumnIndex
public TVList getTvListByColumnIndex(java.util.List<java.lang.Integer> columnIndex, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypeList)
- Overrides:
getTvListByColumnIndexin classTVList
-
extendColumn
public void extendColumn(org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType)
-
getIntByValueIndex
public int getIntByValueIndex(int rowIndex, int columnIndex)Get the int value at the given position in AlignedTvList.- Parameters:
rowIndex- value index inside this columncolumnIndex- index of the column- Returns:
- the value at this position in VectorTvList
-
getLongByValueIndex
public long getLongByValueIndex(int rowIndex, int columnIndex)Get the long value at the given position in VectorTvList.- Parameters:
rowIndex- value index inside this columncolumnIndex- index of the column- Returns:
- the value at this position in VectorTvList
-
getFloatByValueIndex
public float getFloatByValueIndex(int rowIndex, int columnIndex)Get the float value at the given position in VectorTvList.- Parameters:
rowIndex- value index inside this columncolumnIndex- index of the column- Returns:
- the value at this position in VectorTvList
-
getDoubleByValueIndex
public double getDoubleByValueIndex(int rowIndex, int columnIndex)Get the double value at the given position in VectorTvList.- Parameters:
rowIndex- value index inside this columncolumnIndex- index of the column- Returns:
- the value at this position in VectorTvList
-
getBinaryByValueIndex
public org.apache.iotdb.tsfile.utils.Binary getBinaryByValueIndex(int rowIndex, int columnIndex)Get the Binary value at the given position in VectorTvList.- Parameters:
rowIndex- value index inside this columncolumnIndex- index of the column- Returns:
- the value at this position in VectorTvList
-
getBooleanByValueIndex
public boolean getBooleanByValueIndex(int rowIndex, int columnIndex)Get the boolean value at the given position in VectorTvList.- Parameters:
rowIndex- value index inside this columncolumnIndex- index of the column- Returns:
- the value at this position in VectorTvList
-
isNullValue
public boolean isNullValue(int rowIndex, int columnIndex)Get whether value is null at the given position in AlignedTvList.- Parameters:
rowIndex- value index inside this columncolumnIndex- index of the column- Returns:
- boolean
-
getValues
public java.util.List<java.util.List<java.lang.Object>> getValues()
-
getTsDataTypes
public java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> getTsDataTypes()
-
delete
public org.apache.iotdb.tsfile.utils.Pair<java.lang.Integer,java.lang.Boolean> delete(long lowerBound, long upperBound, int columnIndex)Delete points in a specific column.- Parameters:
lowerBound- deletion lower boundupperBound- deletion upper boundcolumnIndex- column index to be deleted- Returns:
- Delete info pair. Left: deletedNumber int; right: ifDeleteColumn boolean
-
deleteColumn
public void deleteColumn(int columnIndex)
-
clone
public AlignedTVList clone()
-
setFromSorted
protected void setFromSorted(int src, int dest)- Specified by:
setFromSortedin classTVList
-
setToSorted
protected void setToSorted(int src, int dest)- Specified by:
setToSortedin classTVList
-
reverseRange
protected void reverseRange(int lo, int hi)- Specified by:
reverseRangein classTVList
-
expandValues
protected void expandValues()
- Specified by:
expandValuesin classTVList
-
saveAsPivot
protected void saveAsPivot(int pos)
- Specified by:
saveAsPivotin classTVList
-
getValueIndex
public int getValueIndex(int index)
Get the row index value in index column- Overrides:
getValueIndexin classTVList- Parameters:
index- row index
-
getValidRowIndexForTimeDuplicatedRows
public int getValidRowIndexForTimeDuplicatedRows(java.util.List<java.lang.Integer> timeDuplicatedOriginRowIndexList, int columnIndex)Get the valid original row index in a column by a given time duplicated original row index list.- Parameters:
timeDuplicatedOriginRowIndexList- The row index list that the time of all indexes are same.columnIndex- The index of a given column.- Returns:
- The original row index of the latest non-null value, or the first row index if all values in given columns are null.
-
setPivotTo
protected void setPivotTo(int pos)
- Specified by:
setPivotToin classTVList
-
getTimeValuePair
public org.apache.iotdb.tsfile.read.TimeValuePair getTimeValuePair(int index)
Description copied from class:TVListfor log- Specified by:
getTimeValuePairin classTVList
-
getTimeValuePair
protected org.apache.iotdb.tsfile.read.TimeValuePair getTimeValuePair(int index, long time, java.lang.Integer floatPrecision, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodingList)
-
releaseLastValueArray
protected void releaseLastValueArray()
- Specified by:
releaseLastValueArrayin classTVList
-
putAlignedValues
public void putAlignedValues(long[] time, java.lang.Object[] value, org.apache.iotdb.tsfile.utils.BitMap[] bitMaps, int[] columnIndexArray, int start, int end)- Overrides:
putAlignedValuesin classTVList
-
getDataType
public org.apache.iotdb.tsfile.file.metadata.enums.TSDataType getDataType()
- Specified by:
getDataTypein classTVList
-
alignedTvListArrayMemCost
public static long alignedTvListArrayMemCost(org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] types)
Get the single alignedTVList array mem cost by give types.- Parameters:
types- the types in the vector- Returns:
- AlignedTvListArrayMemSize
-
buildTsBlock
public org.apache.iotdb.tsfile.read.common.block.TsBlock buildTsBlock(int floatPrecision, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodingList, java.util.List<java.util.List<org.apache.iotdb.tsfile.read.common.TimeRange>> deletionList)Build TsBlock by column.
-
writeValidValuesIntoTsBlock
protected void writeValidValuesIntoTsBlock(org.apache.iotdb.tsfile.read.common.block.TsBlockBuilder builder, int floatPrecision, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding, java.util.List<org.apache.iotdb.tsfile.read.common.TimeRange> deletionList)- Specified by:
writeValidValuesIntoTsBlockin classTVList
-
serializedSize
public int serializedSize()
Description copied from interface:SerializedSizeCalculate size after serialization.- Returns:
- bytes number
-
serializeToWAL
public void serializeToWAL(IWALByteBufferView buffer)
Description copied from interface:WALEntryValueSerialize usingIWALByteBufferView, which encapsulates some actions to deal withBufferOverflowExceptionoccurs inByteBuffer.
-
deserialize
public static AlignedTVList deserialize(java.io.DataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
-