Class DictionaryReaderRegistry

java.lang.Object
io.deephaven.extensions.barrage.chunk.DictionaryReaderRegistry
All Implemented Interfaces:
SafeCloseable, AutoCloseable

public final class DictionaryReaderRegistry extends Object implements SafeCloseable
Per-stream registry that maps Arrow dictionary ids to their decoded value chunks.

When the barrage/Arrow reader encounters a DictionaryBatch message, it decodes the single-column body into a WritableChunk<Values> and calls update(long, Chunk, boolean) to install or append values. DictionaryChunkReaders hold a reference to the registry and look up their id during readChunk to expand index values to their logical type.

Thread-safety: not thread-safe; single-threaded stream reading is assumed.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Releases all retained value chunks.
    @Nullable io.deephaven.extensions.barrage.chunk.DictionaryReaderValues
    get(long dictId)
    Returns the ordered dictionary values for dictId, or null if no dictionary has been received for that id yet.
    void
    update(long dictId, @NotNull Chunk<Values> valuesChunk, boolean isDelta)
    Installs or updates the dictionary for dictId.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DictionaryReaderRegistry

      public DictionaryReaderRegistry()
  • Method Details

    • update

      public void update(long dictId, @NotNull @NotNull Chunk<Values> valuesChunk, boolean isDelta)
      Installs or updates the dictionary for dictId.
      Parameters:
      dictId - the Arrow dictionary id
      valuesChunk - the decoded values for this batch; the values are copied into internal storage, and the caller retains ownership of the chunk
      isDelta - false to replace the whole dictionary; true to append
    • get

      @Nullable public @Nullable io.deephaven.extensions.barrage.chunk.DictionaryReaderValues get(long dictId)
      Returns the ordered dictionary values for dictId, or null if no dictionary has been received for that id yet.
    • close

      public void close()
      Releases all retained value chunks.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface SafeCloseable