Class BaseImmutableDictionary
- java.lang.Object
-
- org.apache.pinot.segment.local.segment.index.readers.BaseImmutableDictionary
-
- All Implemented Interfaces:
Closeable,AutoCloseable,IndexReader,Dictionary
- Direct Known Subclasses:
BigDecimalDictionary,BytesDictionary,ConstantValueBigDecimalDictionary,ConstantValueBytesDictionary,ConstantValueDoubleDictionary,ConstantValueFloatDictionary,ConstantValueIntDictionary,ConstantValueLongDictionary,ConstantValueStringDictionary,DocIdDictionary,DoubleDictionary,FloatDictionary,IntDictionary,LongDictionary,OnHeapBigDecimalDictionary,OnHeapBytesDictionary,OnHeapDoubleDictionary,OnHeapFloatDictionary,OnHeapIntDictionary,OnHeapLongDictionary,OnHeapStringDictionary,StringDictionary
public abstract class BaseImmutableDictionary extends Object implements Dictionary
Base implementation of immutable dictionary.
-
-
Field Summary
-
Fields inherited from interface org.apache.pinot.segment.spi.index.reader.Dictionary
NULL_VALUE_INDEX
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseImmutableDictionary(int length)For virtual dictionary.protectedBaseImmutableDictionary(PinotDataBuffer dataBuffer, int length, int numBytesPerValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intbinarySearch(byte[] value)protected intbinarySearch(double value)protected intbinarySearch(float value)protected intbinarySearch(int value)protected intbinarySearch(long value)protected intbinarySearch(String value)protected intbinarySearch(BigDecimal value)voidclose()intcompare(int dictId1, int dictId2)protected BigDecimalgetBigDecimal(int dictId)protected byte[]getBuffer()protected byte[]getBytes(int dictId)voidgetDictIds(List<String> sortedValues, it.unimi.dsi.fastutil.ints.IntSet dictIds)Returns the dictionary id for the given sorted values.it.unimi.dsi.fastutil.ints.IntSetgetDictIdsInRange(String lower, String upper, boolean includeLower, boolean includeUpper)protected doublegetDouble(int dictId)protected floatgetFloat(int dictId)protected intgetInt(int dictId)protected longgetLong(int dictId)ComparablegetMaxVal()ComparablegetMinVal()protected StringgetPaddedString(int dictId, byte[] buffer)ObjectgetSortedValues()protected byte[]getUnpaddedBytes(int dictId, byte[] buffer)protected StringgetUnpaddedString(int dictId, byte[] buffer)intindexOf(String stringValue)booleanisSorted()intlength()protected intnormalizeIndex(int index)-
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
get, getBigDecimalValue, getByteArrayValue, getBytesValue, getDoubleValue, getFloatValue, getInternal, getIntValue, getLongValue, getStringValue, getValueType, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, insertionIndexOf, readBigDecimalValues, readBytesValues, readDoubleValues, readFloatValues, readIntValues, readLongValues, readStringValues
-
-
-
-
Constructor Detail
-
BaseImmutableDictionary
protected BaseImmutableDictionary(PinotDataBuffer dataBuffer, int length, int numBytesPerValue)
-
BaseImmutableDictionary
protected BaseImmutableDictionary(int length)
For virtual dictionary.
-
-
Method Detail
-
isSorted
public boolean isSorted()
- Specified by:
isSortedin interfaceDictionary
-
length
public int length()
- Specified by:
lengthin interfaceDictionary
-
indexOf
public int indexOf(String stringValue)
- Specified by:
indexOfin interfaceDictionary
-
normalizeIndex
protected final int normalizeIndex(int index)
-
getDictIdsInRange
public it.unimi.dsi.fastutil.ints.IntSet getDictIdsInRange(String lower, String upper, boolean includeLower, boolean includeUpper)
- Specified by:
getDictIdsInRangein interfaceDictionary
-
compare
public int compare(int dictId1, int dictId2)- Specified by:
comparein interfaceDictionary
-
getMinVal
public Comparable getMinVal()
- Specified by:
getMinValin interfaceDictionary
-
getMaxVal
public Comparable getMaxVal()
- Specified by:
getMaxValin interfaceDictionary
-
getSortedValues
public Object getSortedValues()
- Specified by:
getSortedValuesin interfaceDictionary
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
binarySearch
protected int binarySearch(int value)
-
binarySearch
protected int binarySearch(long value)
-
binarySearch
protected int binarySearch(float value)
-
binarySearch
protected int binarySearch(double value)
-
binarySearch
protected int binarySearch(BigDecimal value)
-
binarySearch
protected int binarySearch(String value)
-
binarySearch
protected int binarySearch(byte[] value)
-
getInt
protected int getInt(int dictId)
-
getLong
protected long getLong(int dictId)
-
getFloat
protected float getFloat(int dictId)
-
getDouble
protected double getDouble(int dictId)
-
getBigDecimal
protected BigDecimal getBigDecimal(int dictId)
-
getUnpaddedBytes
protected byte[] getUnpaddedBytes(int dictId, byte[] buffer)
-
getUnpaddedString
protected String getUnpaddedString(int dictId, byte[] buffer)
-
getPaddedString
protected String getPaddedString(int dictId, byte[] buffer)
-
getBytes
protected byte[] getBytes(int dictId)
-
getBuffer
protected byte[] getBuffer()
-
getDictIds
public void getDictIds(List<String> sortedValues, it.unimi.dsi.fastutil.ints.IntSet dictIds)
Returns the dictionary id for the given sorted values.- Specified by:
getDictIdsin interfaceDictionary- Parameters:
sortedValues-dictIds-
-
-