Interface DictionaryWriterValueMap
public interface DictionaryWriterValueMap
An insertion-ordered map from distinct column values to their dictionary indices. One implementation per source
ChunkType; each owns a typed fastutil hash map and a typed fastutil array list so that the hot path (index
lookup and registration) and the delta-build path (typed chunk construction) are both free of boxing.
Thread-safety: not thread-safe; single-threaded barrage stream serialization is assumed.
-
Method Summary
Modifier and TypeMethodDescription@NotNull WritableChunk<Values> buildChunk(int fromInclusive, int toExclusive) Builds and returns a typed chunk containing the distinct values in insertion order over[fromInclusive, toExclusive).voidfillIndexChunk(@NotNull Chunk<Values> source, @Nullable RowSet subset, boolean useDeephavenNulls, @NotNull WritableIntChunk<Values> out) Fillsoutwith one dictionary index per logical row insource/subset, registering new values as they are encountered.static DictionaryWriterValueMapvoidreset()Discards all accumulated values and index assignments.intsize()Number of distinct values accumulated since construction or the lastreset().
-
Method Details
-
fillIndexChunk
void fillIndexChunk(@NotNull @NotNull Chunk<Values> source, @Nullable @Nullable RowSet subset, boolean useDeephavenNulls, @NotNull @NotNull WritableIntChunk<Values> out) Fillsoutwith one dictionary index per logical row insource/subset, registering new values as they are encountered. Null rows (in non-deephaven-nulls mode) produceQueryConstants.NULL_INT; non-null rows produce a non-negative dictionary index.outmust be pre-sized to the logical row count by the caller; this method never callsout.setSize().- Parameters:
source- the source chunk containing column valuessubset- row positions withinsourceto include;nullmeans all rowsuseDeephavenNulls- whentrue, null sentinel values are dictionary-encoded like any other value; whenfalse, they map toQueryConstants.NULL_INTout- pre-sized output chunk to fill with dictionary indices
-
buildChunk
Builds and returns a typed chunk containing the distinct values in insertion order over[fromInclusive, toExclusive). The returned chunk is owned by the caller and must be closed when no longer needed. -
size
int size()Number of distinct values accumulated since construction or the lastreset(). -
reset
void reset()Discards all accumulated values and index assignments. -
make
-