Class RowDataBlock
- java.lang.Object
-
- org.apache.pinot.common.datablock.BaseDataBlock
-
- org.apache.pinot.common.datablock.RowDataBlock
-
- All Implemented Interfaces:
DataBlock
public class RowDataBlock extends BaseDataBlock
Wrapper for row-wise data table. It stores data in row-major format.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.pinot.common.datablock.DataBlock
DataBlock.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]_columnOffsetsprotected int_rowSizeInBytes-
Fields inherited from class org.apache.pinot.common.datablock.BaseDataBlock
_dataSchema, _errCodeToExceptionMap, _fixDataSize, _fixedSizeData, _fixedSizeDataBytes, _metadata, _numColumns, _numRows, _stringDictionary, _variableSizeData, _variableSizeDataBytes, HEADER_SIZE
-
-
Constructor Summary
Constructors Constructor Description RowDataBlock()RowDataBlock(int numRows, DataSchema dataSchema, String[] stringDictionary, byte[] fixedSizeDataBytes, byte[] variableSizeDataBytes)RowDataBlock(ByteBuffer byteBuffer)
-
Method Summary
Modifier and Type Method Description protected voidcomputeBlockObjectConstants()protected intgetDataBlockVersionType()Return the int serialized form of the data block version and type.protected intgetOffsetInFixedBuffer(int rowId, int colId)return the offset in_fixedSizeDataBytesof the row/column ID.intgetRowSizeInBytes()protected intpositionOffsetInVariableBufferAndGetLength(int rowId, int colId)position the_variableSizeDataBytesto the corresponding row/column ID.RowDataBlocktoDataOnlyDataTable()RowDataBlocktoMetadataOnlyDataTable()-
Methods inherited from class org.apache.pinot.common.datablock.BaseDataBlock
addException, addException, deserializeStringDictionary, getBigDecimal, getBytes, getDataSchema, getDouble, getDoubleArray, getExceptions, getFloat, getFloatArray, getInt, getIntArray, getLong, getLongArray, getMetadata, getNullRowIds, getNumberOfRows, getString, getStringArray, getVersion, serializeStringDictionary, toBytes, toString
-
-
-
-
Constructor Detail
-
RowDataBlock
public RowDataBlock()
-
RowDataBlock
public RowDataBlock(int numRows, DataSchema dataSchema, String[] stringDictionary, byte[] fixedSizeDataBytes, byte[] variableSizeDataBytes)
-
RowDataBlock
public RowDataBlock(ByteBuffer byteBuffer) throws IOException
- Throws:
IOException
-
-
Method Detail
-
computeBlockObjectConstants
protected void computeBlockObjectConstants()
-
getDataBlockVersionType
protected int getDataBlockVersionType()
Description copied from class:BaseDataBlockReturn the int serialized form of the data block version and type.- Specified by:
getDataBlockVersionTypein classBaseDataBlock- Returns:
-
getOffsetInFixedBuffer
protected int getOffsetInFixedBuffer(int rowId, int colId)Description copied from class:BaseDataBlockreturn the offset in_fixedSizeDataBytesof the row/column ID.- Specified by:
getOffsetInFixedBufferin classBaseDataBlock- Parameters:
rowId- row IDcolId- column ID- Returns:
- the offset in the fixed size buffer for the row/columnID.
-
positionOffsetInVariableBufferAndGetLength
protected int positionOffsetInVariableBufferAndGetLength(int rowId, int colId)Description copied from class:BaseDataBlockposition the_variableSizeDataBytesto the corresponding row/column ID. and return the length of bytes to extract from the variable size buffer.- Specified by:
positionOffsetInVariableBufferAndGetLengthin classBaseDataBlock- Parameters:
rowId- row IDcolId- column ID- Returns:
- the length to extract from variable size buffer.
-
toMetadataOnlyDataTable
public RowDataBlock toMetadataOnlyDataTable()
-
toDataOnlyDataTable
public RowDataBlock toDataOnlyDataTable()
-
getRowSizeInBytes
public int getRowSizeInBytes()
-
-