Interface DictionaryWriterRegistry
- All Known Implementing Classes:
DictionaryWriterRegistryImpl,WebDictionaryWriterRegistryImpl
DictionaryWriterState instances for a single barrage stream (snapshot or subscription
update sequence), one per Arrow dictionary id.
When BarrageMessageWriterImpl processes a batch, it calls
getOrCreate(long, io.deephaven.extensions.barrage.chunk.ChunkWriter<io.deephaven.chunk.Chunk<io.deephaven.chunk.attributes.Values>>, io.deephaven.chunk.ChunkType) for each DictionaryChunkWriter column to obtain (or register) the state for that
column's dictionary id. After the batch's column data is serialized, the registry's entries() are inspected
to determine which dictionary ids have pending deltas that need a DictionaryBatch
message.
The server implementation is DictionaryWriterRegistryImpl. The JS API supplies its own implementation, since
the server implementation's fastutil backing is not available under GWT.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classPer-id state plus the values writer needed to serialize dictionary values into a DictionaryBatch. -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<DictionaryWriterRegistry.Entry> entries()Returns all registered entries.@NotNull DictionaryWriterStategetOrCreate(long dictId, @NotNull ChunkWriter<Chunk<Values>> valuesWriter, @NotNull ChunkType valuesChunkType) Returns (or creates) theDictionaryWriterStatefor the given dictionary id.booleanReturnstrueif any registered dictionary has a pending delta that needs a DictionaryBatch message.voidAdvances the delta boundary for every registered state that currently has a pending delta.voidresetOverflowedEntries(long liveRowCount) Checks each registeredDictionaryWriterStatefor overflow: if itstotalSizeexceedsliveRowCount, callsDictionaryWriterState.reset()so the next DictionaryBatch will beisDelta=falsewith a compacted dictionary.
-
Method Details
-
getOrCreate
@NotNull @NotNull DictionaryWriterState getOrCreate(long dictId, @NotNull @NotNull ChunkWriter<Chunk<Values>> valuesWriter, @NotNull @NotNull ChunkType valuesChunkType) Returns (or creates) theDictionaryWriterStatefor the given dictionary id.The first call for a given
dictIdregisters thevaluesWriterfor that id and creates the appropriate state type. Subsequent calls for the same id return the existing state. -
entries
Returns all registered entries. -
hasAnyDelta
boolean hasAnyDelta()Returnstrueif any registered dictionary has a pending delta that needs a DictionaryBatch message. -
resetDeltas
void resetDeltas()Advances the delta boundary for every registered state that currently has a pending delta. -
resetOverflowedEntries
void resetOverflowedEntries(long liveRowCount) Checks each registeredDictionaryWriterStatefor overflow: if itstotalSizeexceedsliveRowCount, callsDictionaryWriterState.reset()so the next DictionaryBatch will beisDelta=falsewith a compacted dictionary. Only call this for local (viewport/snapshot) registries; for shared-backed registries theSharedWriterDictionaryis reset externally.- Parameters:
liveRowCount- the current number of live rows visible to this subscription
-