Package org.apache.druid.segment
Class ComparatorDimensionDictionary<T>
java.lang.Object
org.apache.druid.segment.ComparatorDimensionDictionary<T>
Comparator based DimensionDictionary
there are a lot of unused methods in here for now since the only thing this is used for is to build up
the unsorted dictionary and then it is converted to a ComparatorSortedDimensionDictionary, but
leaving the unused methods in place for now to be basically compatible with the other implementation.
This version is not thread-safe since the only current user doesn't use the dictionary for realtime queries, if this
changes we need to add a 'ConcurrentComparatorDimensionDictionary'.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintlongestimateSizeOfValue(T value) Estimates the size of the dimension value in bytes.intintgetValue(int id) intsize()longGets the current size of this dictionary in bytes.sort()
-
Field Details
-
ABSENT_VALUE_ID
public static final int ABSENT_VALUE_ID- See Also:
-
-
Constructor Details
-
ComparatorDimensionDictionary
-
-
Method Details
-
getId
-
getValue
-
size
public int size() -
sizeInBytes
public long sizeInBytes()Gets the current size of this dictionary in bytes.- Throws:
IllegalStateException- if size computation is disabled.
-
add
-
getMinValue
-
getMaxValue
-
getIdForNull
public int getIdForNull() -
sort
-
estimateSizeOfValue
Estimates the size of the dimension value in bytes. This method is called only when a new dimension value is being added to the lookup.- Throws:
UnsupportedOperationException- Implementations that want to estimate memory must override this method.
-