Class DescReadWriteBatchData
- java.lang.Object
-
- org.apache.iotdb.tsfile.read.common.BatchData
-
- org.apache.iotdb.tsfile.read.common.DescReadBatchData
-
- org.apache.iotdb.tsfile.read.common.DescReadWriteBatchData
-
public class DescReadWriteBatchData extends DescReadBatchData
This class is for reading and writing batch data in reverse. The data source is from mergeReader. For example, the time sequence from mergeReader is 1000 -> 1, to keep the consistency that the timestamp should be ascending. It will be written in reverse, i.e. the timeRet will be [1, 1000]. Then it can be handled the same as DescReadBatchData.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.iotdb.tsfile.read.common.BatchData
BatchData.BatchDataType
-
-
Field Summary
-
Fields inherited from class org.apache.iotdb.tsfile.read.common.BatchData
batchDataType, binaryRet, booleanRet, capacity, CAPACITY_THRESHOLD, count, dataType, doubleRet, floatRet, intRet, longRet, readCurArrayIndex, readCurListIndex, timeRet, vectorRet, writeCurArrayIndex, writeCurListIndex
-
-
Constructor Summary
Constructors Constructor Description DescReadWriteBatchData(TSDataType dataType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BatchDataflip()Read: When put data, the writeIndex increases while the readIndex remains 0.BinarygetBinaryByIndex(int idx)Get the idx th binary value by the time ascending orderbooleangetBooleanByIndex(int idx)Get the idx th boolean value by the time ascending orderdoublegetDoubleByIndex(int idx)Get the idx th double value by the time ascending orderfloatgetFloatByIndex(int idx)Get the idx th float value by the time ascending orderintgetIntByIndex(int idx)Get the idx th int value by the time ascending orderlonggetLongByIndex(int idx)Get the idx th long value by the time ascending orderlonggetTimeByIndex(int idx)Get the idx th timestamp by the time ascending orderTsPrimitiveType[]getVectorByIndex(int idx)Get the idx th vector value by the time ascending orderbooleanhasCurrent()voidnext()voidputBinary(long t, Binary v)put binary data reversely.voidputBoolean(long t, boolean v)put boolean data reversely.voidputDouble(long t, double v)put double data reversely.voidputFloat(long t, float v)put float data reversely.voidputInt(long t, int v)put int data reversely.voidputLong(long t, long v)put long data reversely.voidputVector(long t, TsPrimitiveType[] v)put vector data.voidresetBatchData()This method is used to reset batch data when more than one group by aggregation functions visit the same batch datavoidserializeData(java.io.DataOutputStream outputStream)For any implementation of BatchData, the data serializing sequence must equal the one of writing, otherwise after deserializing the sequence will be reversed-
Methods inherited from class org.apache.iotdb.tsfile.read.common.DescReadBatchData
getValueInTimestamp
-
Methods inherited from class org.apache.iotdb.tsfile.read.common.BatchData
currentTime, currentTsPrimitiveType, currentValue, getBatchDataIterator, getBatchDataIterator, getBatchDataType, getBinary, getBoolean, getDataType, getDouble, getFloat, getInt, getLastPairBeforeOrEqualTimestamp, getLong, getMaxTimestamp, getMinTimestamp, getReadCurArrayIndex, getReadCurListIndex, getVector, init, isEmpty, length, putAnObject, resetBatchData, setBinary, setBoolean, setDataType, setDouble, setFloat, setInt, setLong, setTime, setVector
-
-
-
-
Constructor Detail
-
DescReadWriteBatchData
public DescReadWriteBatchData(TSDataType dataType)
-
-
Method Detail
-
putBoolean
public void putBoolean(long t, boolean v)put boolean data reversely.- Overrides:
putBooleanin classBatchData- Parameters:
t- timestampv- boolean data
-
putInt
public void putInt(long t, int v)put int data reversely.
-
putLong
public void putLong(long t, long v)put long data reversely.
-
putFloat
public void putFloat(long t, float v)put float data reversely.
-
putDouble
public void putDouble(long t, double v)put double data reversely.
-
putBinary
public void putBinary(long t, Binary v)put binary data reversely.
-
putVector
public void putVector(long t, TsPrimitiveType[] v)put vector data.
-
hasCurrent
public boolean hasCurrent()
- Overrides:
hasCurrentin classDescReadBatchData
-
next
public void next()
- Overrides:
nextin classDescReadBatchData
-
resetBatchData
public void resetBatchData()
Description copied from class:BatchDataThis method is used to reset batch data when more than one group by aggregation functions visit the same batch data- Overrides:
resetBatchDatain classDescReadBatchData
-
getTimeByIndex
public long getTimeByIndex(int idx)
Description copied from class:BatchDataGet the idx th timestamp by the time ascending order- Overrides:
getTimeByIndexin classBatchData
-
getLongByIndex
public long getLongByIndex(int idx)
Description copied from class:BatchDataGet the idx th long value by the time ascending order- Overrides:
getLongByIndexin classBatchData
-
getDoubleByIndex
public double getDoubleByIndex(int idx)
Description copied from class:BatchDataGet the idx th double value by the time ascending order- Overrides:
getDoubleByIndexin classBatchData
-
getIntByIndex
public int getIntByIndex(int idx)
Description copied from class:BatchDataGet the idx th int value by the time ascending order- Overrides:
getIntByIndexin classBatchData
-
getFloatByIndex
public float getFloatByIndex(int idx)
Description copied from class:BatchDataGet the idx th float value by the time ascending order- Overrides:
getFloatByIndexin classBatchData
-
getBinaryByIndex
public Binary getBinaryByIndex(int idx)
Description copied from class:BatchDataGet the idx th binary value by the time ascending order- Overrides:
getBinaryByIndexin classBatchData
-
getBooleanByIndex
public boolean getBooleanByIndex(int idx)
Description copied from class:BatchDataGet the idx th boolean value by the time ascending order- Overrides:
getBooleanByIndexin classBatchData
-
getVectorByIndex
public TsPrimitiveType[] getVectorByIndex(int idx)
Description copied from class:BatchDataGet the idx th vector value by the time ascending order- Overrides:
getVectorByIndexin classBatchData
-
serializeData
public void serializeData(java.io.DataOutputStream outputStream) throws java.io.IOExceptionDescription copied from class:BatchDataFor any implementation of BatchData, the data serializing sequence must equal the one of writing, otherwise after deserializing the sequence will be reversed- Overrides:
serializeDatain classBatchData- Throws:
java.io.IOException
-
flip
public BatchData flip()
Read: When put data, the writeIndex increases while the readIndex remains 0. For descending read, we need to read from writeIndex to writeCurArrayIndex- Overrides:
flipin classDescReadBatchData
-
-