Class FixedByteSVMutableForwardIndex
- java.lang.Object
-
- org.apache.pinot.segment.local.realtime.impl.forward.FixedByteSVMutableForwardIndex
-
- All Implemented Interfaces:
Closeable,AutoCloseable,MutableForwardIndex,ForwardIndexReader<ForwardIndexReaderContext>
public class FixedByteSVMutableForwardIndex extends Object implements MutableForwardIndex
This class implements reader as well as writer interfaces for fixed-byte single column and single value data.- Auto expands memory allocation on-demand.
- Supports random reads and writes.
- Callers should ensure they are only reading row that were written, as allocated but not written rows are not guaranteed to have a deterministic value.
-
-
Constructor Summary
Constructors Constructor Description FixedByteSVMutableForwardIndex(boolean dictionaryEncoded, FieldSpec.DataType storedType, int numRowsPerChunk, PinotDataBufferMemoryManager memoryManager, String allocationContext)
-
Method Summary
Modifier and Type Method Description voidclose()BigDecimalgetBigDecimal(int docId)intgetDictId(int docId)doublegetDouble(int docId)floatgetFloat(int docId)intgetInt(int docId)intgetLengthOfLongestElement()intgetLengthOfShortestElement()longgetLong(int docId)FieldSpec.DataTypegetStoredType()booleanisDictionaryEncoded()booleanisSingleValue()voidreadDictIds(int[] docIds, int length, int[] dictIdBuffer)voidsetDictId(int docId, int dictId)voidsetDouble(int docId, double value)voidsetFloat(int docId, float value)voidsetInt(int docId, int value)voidsetLong(int docId, 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.spi.index.reader.ForwardIndexReader
createContext, getCompressionType, getLengthOfLongestEntry, readValuesMV, readValuesMV, readValuesMV, readValuesMV, readValuesMV, readValuesMV, readValuesSV, readValuesSV, readValuesSV, readValuesSV, readValuesSV
-
Methods inherited from interface org.apache.pinot.segment.spi.index.mutable.MutableForwardIndex
getBigDecimal, getBytes, getBytes, getBytesMV, getBytesMV, getBytesMV, getBytesMV, getDictId, getDictIdMV, getDictIdMV, getDictIdMV, getDictIdMV, getDouble, getDoubleMV, getDoubleMV, getDoubleMV, getDoubleMV, getFloat, getFloatMV, getFloatMV, getFloatMV, getFloatMV, getInt, getIntMV, getIntMV, getIntMV, getIntMV, getLong, getLongMV, getLongMV, getLongMV, getLongMV, getNumValuesMV, getNumValuesMV, getString, getString, getStringMV, getStringMV, getStringMV, getStringMV, readDictIds, setBigDecimal, setBytes, setBytesMV, setDictIdMV, setDoubleMV, setFloatMV, setIntMV, setLongMV, setString, setStringMV
-
-
-
-
Constructor Detail
-
FixedByteSVMutableForwardIndex
public FixedByteSVMutableForwardIndex(boolean dictionaryEncoded, FieldSpec.DataType storedType, int numRowsPerChunk, PinotDataBufferMemoryManager memoryManager, String allocationContext)- Parameters:
storedType- Data type of the valuesnumRowsPerChunk- Number of rows to pack in one chunk before a new chunk is created.memoryManager- Memory manager to be used for allocating memory.allocationContext- Allocation allocationContext.
-
-
Method Detail
-
isDictionaryEncoded
public boolean isDictionaryEncoded()
- Specified by:
isDictionaryEncodedin interfaceForwardIndexReader<ForwardIndexReaderContext>
-
isSingleValue
public boolean isSingleValue()
- Specified by:
isSingleValuein interfaceForwardIndexReader<ForwardIndexReaderContext>
-
getStoredType
public FieldSpec.DataType getStoredType()
- Specified by:
getStoredTypein interfaceForwardIndexReader<ForwardIndexReaderContext>
-
getLengthOfShortestElement
public int getLengthOfShortestElement()
- Specified by:
getLengthOfShortestElementin interfaceMutableForwardIndex
-
getLengthOfLongestElement
public int getLengthOfLongestElement()
- Specified by:
getLengthOfLongestElementin interfaceMutableForwardIndex
-
getDictId
public int getDictId(int docId)
- Specified by:
getDictIdin interfaceMutableForwardIndex
-
readDictIds
public void readDictIds(int[] docIds, int length, int[] dictIdBuffer)- Specified by:
readDictIdsin interfaceMutableForwardIndex
-
getInt
public int getInt(int docId)
- Specified by:
getIntin interfaceMutableForwardIndex
-
getLong
public long getLong(int docId)
- Specified by:
getLongin interfaceMutableForwardIndex
-
getFloat
public float getFloat(int docId)
- Specified by:
getFloatin interfaceMutableForwardIndex
-
getDouble
public double getDouble(int docId)
- Specified by:
getDoublein interfaceMutableForwardIndex
-
getBigDecimal
public BigDecimal getBigDecimal(int docId)
- Specified by:
getBigDecimalin interfaceMutableForwardIndex
-
setDictId
public void setDictId(int docId, int dictId)- Specified by:
setDictIdin interfaceMutableForwardIndex
-
setInt
public void setInt(int docId, int value)- Specified by:
setIntin interfaceMutableForwardIndex
-
setLong
public void setLong(int docId, long value)- Specified by:
setLongin interfaceMutableForwardIndex
-
setFloat
public void setFloat(int docId, float value)- Specified by:
setFloatin interfaceMutableForwardIndex
-
setDouble
public void setDouble(int docId, double value)- Specified by:
setDoublein interfaceMutableForwardIndex
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-