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 Type
    Method
    Description
    buildChunk(int fromInclusive, int toExclusive)
    Builds and returns a typed chunk containing the distinct values in insertion order over [fromInclusive, toExclusive).
    void
    fillIndexChunk(@NotNull Chunk<Values> source, @Nullable RowSet subset, boolean useDeephavenNulls, @NotNull WritableIntChunk<Values> out)
    Fills out with one dictionary index per logical row in source/subset, registering new values as they are encountered.
    make(ChunkType valuesChunkType)
     
    void
    Discards all accumulated values and index assignments.
    int
    Number of distinct values accumulated since construction or the last reset().
  • Method Details

    • fillIndexChunk

      void fillIndexChunk(@NotNull @NotNull Chunk<Values> source, @Nullable @Nullable RowSet subset, boolean useDeephavenNulls, @NotNull @NotNull WritableIntChunk<Values> out)
      Fills out with one dictionary index per logical row in source/subset, registering new values as they are encountered. Null rows (in non-deephaven-nulls mode) produce QueryConstants.NULL_INT; non-null rows produce a non-negative dictionary index.

      out must be pre-sized to the logical row count by the caller; this method never calls out.setSize().

      Parameters:
      source - the source chunk containing column values
      subset - row positions within source to include; null means all rows
      useDeephavenNulls - when true, null sentinel values are dictionary-encoded like any other value; when false, they map to QueryConstants.NULL_INT
      out - pre-sized output chunk to fill with dictionary indices
    • buildChunk

      @NotNull @NotNull WritableChunk<Values> buildChunk(int fromInclusive, int toExclusive)
      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 last reset().
    • reset

      void reset()
      Discards all accumulated values and index assignments.
    • make

      static DictionaryWriterValueMap make(ChunkType valuesChunkType)