Class DictionaryReaderRegistry
java.lang.Object
io.deephaven.extensions.barrage.chunk.DictionaryReaderRegistry
- All Implemented Interfaces:
SafeCloseable,AutoCloseable
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases all retained value chunks.@Nullable io.deephaven.extensions.barrage.chunk.DictionaryReaderValuesget(long dictId) Returns the ordered dictionary values fordictId, ornullif no dictionary has been received for that id yet.voidInstalls or updates the dictionary fordictId.
-
Constructor Details
-
DictionaryReaderRegistry
public DictionaryReaderRegistry()
-
-
Method Details
-
update
Installs or updates the dictionary fordictId.- Parameters:
dictId- the Arrow dictionary idvaluesChunk- the decoded values for this batch; the values are copied into internal storage, and the caller retains ownership of the chunkisDelta-falseto replace the whole dictionary;trueto append
-
get
@Nullable public @Nullable io.deephaven.extensions.barrage.chunk.DictionaryReaderValues get(long dictId) Returns the ordered dictionary values fordictId, ornullif no dictionary has been received for that id yet. -
close
public void close()Releases all retained value chunks.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-