Class VarLengthValueReader
- java.lang.Object
-
- org.apache.pinot.segment.local.io.util.VarLengthValueReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ValueReader
public class VarLengthValueReader extends Object implements ValueReader
The value reader for var-length values (STRING and BYTES). SeeVarLengthValueWriterfor the file layout.
-
-
Constructor Summary
Constructors Constructor Description VarLengthValueReader(PinotDataBuffer dataBuffer)
-
Method Summary
Modifier and Type Method Description voidclose()byte[]getBytes(int index, int numBytesPerValue)NOTE: Do not reuse buffer for BYTES because the return value can have variable length.doublegetDouble(int index)floatgetFloat(int index)intgetInt(int index)longgetLong(int index)intgetNumValues()StringgetPaddedString(int index, int numBytesPerValue, byte[] buffer)NOTE: The passed in reusable buffer should have capacity of at leastnumBytesPerValue.byte[]getUnpaddedBytes(int index, int numBytesPerValue, byte paddingByte, byte[] buffer)Get un-padded bytes for string.StringgetUnpaddedString(int index, int numBytesPerValue, byte paddingByte, byte[] buffer)NOTE: The passed in reusable buffer should have capacity of at leastnumBytesPerValue.static booleanisVarLengthValueBuffer(PinotDataBuffer buffer)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pinot.segment.local.io.util.ValueReader
getBigDecimal
-
-
-
-
Constructor Detail
-
VarLengthValueReader
public VarLengthValueReader(PinotDataBuffer dataBuffer)
-
-
Method Detail
-
isVarLengthValueBuffer
public static boolean isVarLengthValueBuffer(PinotDataBuffer buffer)
-
getNumValues
public int getNumValues()
-
getInt
public int getInt(int index)
- Specified by:
getIntin interfaceValueReader
-
getLong
public long getLong(int index)
- Specified by:
getLongin interfaceValueReader
-
getFloat
public float getFloat(int index)
- Specified by:
getFloatin interfaceValueReader
-
getDouble
public double getDouble(int index)
- Specified by:
getDoublein interfaceValueReader
-
getUnpaddedBytes
public byte[] getUnpaddedBytes(int index, int numBytesPerValue, byte paddingByte, byte[] buffer)Description copied from interface:ValueReaderGet un-padded bytes for string. NOTE: The passed in reusable buffer should have capacity of at leastnumBytesPerValue.- Specified by:
getUnpaddedBytesin interfaceValueReader- Returns:
-
getUnpaddedString
public String getUnpaddedString(int index, int numBytesPerValue, byte paddingByte, byte[] buffer)
Description copied from interface:ValueReaderNOTE: The passed in reusable buffer should have capacity of at leastnumBytesPerValue.- Specified by:
getUnpaddedStringin interfaceValueReader
-
getPaddedString
public String getPaddedString(int index, int numBytesPerValue, byte[] buffer)
Description copied from interface:ValueReaderNOTE: The passed in reusable buffer should have capacity of at leastnumBytesPerValue.- Specified by:
getPaddedStringin interfaceValueReader
-
getBytes
public byte[] getBytes(int index, int numBytesPerValue)Description copied from interface:ValueReaderNOTE: Do not reuse buffer for BYTES because the return value can have variable length.- Specified by:
getBytesin interfaceValueReader
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-