Class UnionChunkWriter<T>

java.lang.Object
io.deephaven.extensions.barrage.chunk.BaseChunkWriter<ObjectChunk<T,Values>>
io.deephaven.extensions.barrage.chunk.UnionChunkWriter<T>
All Implemented Interfaces:
ChunkWriter<ObjectChunk<T,Values>>

public class UnionChunkWriter<T> extends BaseChunkWriter<ObjectChunk<T,Values>>
  • Constructor Details

  • Method Details

    • makeContext

      public UnionChunkWriter<T>.Context makeContext(@NotNull @NotNull ObjectChunk<T,Values> chunk, long rowOffset)
      Description copied from interface: ChunkWriter
      Create a context for the given chunk.
      Specified by:
      makeContext in interface ChunkWriter<T>
      Overrides:
      makeContext in class BaseChunkWriter<ObjectChunk<T,Values>>
      Parameters:
      chunk - the chunk of data to be written
      rowOffset - the offset into the logical message potentially spread over multiple chunks
      Returns:
      a context for the given chunk
    • computeNullCount

      protected int computeNullCount(@NotNull ChunkWriter.Context context, @NotNull @NotNull RowSequence subset)
      Description copied from class: BaseChunkWriter
      Compute the number of nulls in the subset.
      Specified by:
      computeNullCount in class BaseChunkWriter<ObjectChunk<T,Values>>
      Parameters:
      context - the context for the chunk
      subset - the subset of rows to consider
      Returns:
      the number of nulls in the subset
    • writeValidityBufferInternal

      protected void writeValidityBufferInternal(@NotNull ChunkWriter.Context context, @NotNull @NotNull RowSequence subset, @NotNull @NotNull BaseChunkWriter.SerContext serContext)
      Description copied from class: BaseChunkWriter
      Update the validity buffer for the subset.
      Specified by:
      writeValidityBufferInternal in class BaseChunkWriter<ObjectChunk<T,Values>>
      Parameters:
      context - the context for the chunk
      subset - the subset of rows to consider
      serContext - the serialization context
    • getInputStream

      public ChunkWriter.DrainableColumn getInputStream(@NotNull ChunkWriter.Context context, @Nullable @Nullable RowSet subset, @NotNull @NotNull BarrageOptions options) throws IOException
      Description copied from interface: ChunkWriter
      Get an input stream optionally position-space filtered using the provided RowSet.
      Parameters:
      context - the chunk writer context holding the data to be drained to the client
      subset - if provided, is a position-space filter of source data
      options - options for writing to the stream
      Returns:
      a single-use DrainableColumn ready to be drained via grpc
      Throws:
      IOException
    • getInputStream

      public ChunkWriter.DrainableColumn getInputStream(@NotNull ChunkWriter.Context context, @Nullable @Nullable RowSet subset, @NotNull @NotNull BarrageOptions options, @Nullable @Nullable DictionaryWriterRegistry dictionaryRegistry) throws IOException
      Get an input stream, threading a DictionaryWriterRegistry down to any dictionary-encoded writers nested within this writer (e.g. the values child of a run-end-encoded column). Writers that contain no dictionary encoding ignore the registry and behave identically to ChunkWriter.getInputStream(Context, RowSet, BarrageOptions).

      A DictionaryChunkWriter uses the registry to obtain (and register) its per-id DictionaryWriterState, so that the enclosing message writer emits the corresponding DictionaryBatch. Composite writers forward the registry to their children.

      Forwards dictionaryRegistry to each child writer so that a dictionary-encoded member (a Union<..., Dictionary<...>, ...> column) can resolve and register its dictionary state.

      Parameters:
      context - the chunk writer context holding the data to be drained to the client
      subset - if provided, is a position-space filter of source data
      options - options for writing to the stream
      dictionaryRegistry - the per-stream dictionary registry; may be null when the caller does not support dictionary encoding (a nested dictionary-encoded writer will then throw)
      Returns:
      a single-use DrainableColumn ready to be drained via grpc
      Throws:
      IOException