Class OnHeapFloatDictionary
- java.lang.Object
-
- org.apache.pinot.segment.local.segment.index.readers.BaseImmutableDictionary
-
- org.apache.pinot.segment.local.segment.index.readers.OnHeapFloatDictionary
-
- All Implemented Interfaces:
Closeable,AutoCloseable,IndexReader,Dictionary
public class OnHeapFloatDictionary extends BaseImmutableDictionary
Implementation of float dictionary that cache all values on-heap.This is useful for float columns that:
- Have low cardinality float dictionary where memory footprint on-heap is acceptably small
- Is heavily queried
This helps avoid creation of float from byte[].
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.pinot.segment.spi.index.reader.Dictionary
Dictionary.SortedBatchLookupAlgorithm
-
-
Field Summary
-
Fields inherited from interface org.apache.pinot.segment.spi.index.reader.Dictionary
NULL_VALUE_INDEX
-
-
Constructor Summary
Constructors Constructor Description OnHeapFloatDictionary(PinotDataBuffer dataBuffer, int length)Constructor for the class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Floatget(int dictId)BigDecimalgetBigDecimalValue(int dictId)doublegetDoubleValue(int dictId)floatgetFloatValue(int dictId)intgetIntValue(int dictId)longgetLongValue(int dictId)StringgetStringValue(int dictId)FieldSpec.DataTypegetValueType()intindexOf(float floatValue)intindexOf(String stringValue)intinsertionIndexOf(String stringValue)-
Methods inherited from class org.apache.pinot.segment.local.segment.index.readers.BaseImmutableDictionary
binarySearch, binarySearch, binarySearch, binarySearch, binarySearch, binarySearch, binarySearch, close, compare, getBigDecimal, getBuffer, getBytes, getDictIds, getDictIdsInRange, getDouble, getFloat, getInt, getLong, getMaxVal, getMinVal, getPaddedString, getSortedValues, getUnpaddedBytes, getUnpaddedString, isSorted, length, normalizeIndex
-
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.Dictionary
getByteArrayValue, getBytesValue, getDictIds, getInternal, indexOf, indexOf, indexOf, indexOf, indexOf, readBigDecimalValues, readBytesValues, readDoubleValues, readDoubleValues, readFloatValues, readFloatValues, readIntValues, readIntValues, readLongValues, readLongValues, readStringValues
-
-
-
-
Constructor Detail
-
OnHeapFloatDictionary
public OnHeapFloatDictionary(PinotDataBuffer dataBuffer, int length)
Constructor for the class. Populates the value <-> mappings.- Parameters:
dataBuffer- Pinot data bufferlength- Length of the dictionary
-
-
Method Detail
-
getValueType
public FieldSpec.DataType getValueType()
-
indexOf
public int indexOf(String stringValue)
- Specified by:
indexOfin interfaceDictionary- Overrides:
indexOfin classBaseImmutableDictionary
-
indexOf
public int indexOf(float floatValue)
-
insertionIndexOf
public int insertionIndexOf(String stringValue)
-
get
public Float get(int dictId)
-
getIntValue
public int getIntValue(int dictId)
-
getLongValue
public long getLongValue(int dictId)
-
getFloatValue
public float getFloatValue(int dictId)
-
getDoubleValue
public double getDoubleValue(int dictId)
-
getBigDecimalValue
public BigDecimal getBigDecimalValue(int dictId)
-
getStringValue
public String getStringValue(int dictId)
-
-