public abstract class DimensionDictionary<T extends Comparable<T>> extends Object
SortedDimensionDictionary can be constructed with a mapping of ids from this dictionary to the
sorted dictionary with the sort() method.
Concrete implementations of this dictionary must be thread-safe.
| Modifier and Type | Field and Description |
|---|---|
static int |
ABSENT_VALUE_ID |
| Constructor and Description |
|---|
DimensionDictionary(Class<T> cls) |
| Modifier and Type | Method and Description |
|---|---|
int |
add(T originalValue) |
abstract boolean |
computeOnHeapSize()
Whether on-heap size of this dictionary should be computed.
|
abstract long |
estimateSizeOfValue(T value)
Estimates the size of the dimension value in bytes.
|
int |
getId(T value) |
int |
getIdForNull() |
T |
getMaxValue() |
T |
getMinValue() |
T |
getValue(int id) |
T[] |
getValues(int[] ids) |
int |
size() |
long |
sizeInBytes()
Gets the current size of this dictionary in bytes.
|
SortedDimensionDictionary<T> |
sort() |
public static final int ABSENT_VALUE_ID
public T[] getValues(int[] ids)
public int size()
public long sizeInBytes()
IllegalStateException - if size computation is disabled.public T getMinValue()
public T getMaxValue()
public int getIdForNull()
public SortedDimensionDictionary<T> sort()
public abstract long estimateSizeOfValue(T value)
This method is called when adding a new dimension value to the lookup only
if computeOnHeapSize() returns true.
public abstract boolean computeOnHeapSize()
Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.