Class FixedByteValueReaderWriter
- java.lang.Object
-
- org.apache.pinot.segment.local.io.util.FixedByteValueReaderWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ValueReader
public final class FixedByteValueReaderWriter extends Object implements ValueReader
-
-
Constructor Summary
Constructors Constructor Description FixedByteValueReaderWriter(PinotDataBuffer dataBuffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intcompareBytes(int index, int numBytesPerValue, byte[] bytes)Returns the comparison result of the bytes values.intcompareUtf8Bytes(int index, int numBytesPerValue, byte[] bytes)Returns the comparison result of the UTF-8 decoded values.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)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[] buffer)Returns un-padded bytes for string.StringgetUnpaddedString(int index, int numBytesPerValue, byte[] buffer)NOTE: The passed in reusable buffer should have capacity of at leastnumBytesPerValue.voidwriteBytes(int index, int numBytesPerValue, byte[] value)voidwriteDouble(int index, double value)voidwriteFloat(int index, float value)voidwriteInt(int index, int value)voidwriteLong(int index, long value)-
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
-
FixedByteValueReaderWriter
public FixedByteValueReaderWriter(PinotDataBuffer dataBuffer)
-
-
Method Detail
-
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[] buffer)Description copied from interface:ValueReaderReturns un-padded bytes for string. NOTE: The passed in reusable buffer should have capacity of at leastnumBytesPerValue.- Specified by:
getUnpaddedBytesin interfaceValueReader
-
getUnpaddedString
public String getUnpaddedString(int index, int numBytesPerValue, 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
-
compareUtf8Bytes
public int compareUtf8Bytes(int index, int numBytesPerValue, byte[] bytes)Description copied from interface:ValueReaderReturns the comparison result of the UTF-8 decoded values.- Specified by:
compareUtf8Bytesin interfaceValueReader
-
compareBytes
public int compareBytes(int index, int numBytesPerValue, byte[] bytes)Description copied from interface:ValueReaderReturns the comparison result of the bytes values.- Specified by:
compareBytesin interfaceValueReader
-
writeInt
public void writeInt(int index, int value)
-
writeLong
public void writeLong(int index, long value)
-
writeFloat
public void writeFloat(int index, float value)
-
writeDouble
public void writeDouble(int index, double value)
-
writeBytes
public void writeBytes(int index, int numBytesPerValue, byte[] value)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-