Class RunEndEncodedChunkWriter

java.lang.Object
io.deephaven.extensions.barrage.chunk.BaseChunkWriter<Chunk<Values>>
io.deephaven.extensions.barrage.chunk.RunEndEncodedChunkWriter
All Implemented Interfaces:
ChunkWriter<Chunk<Values>>

public class RunEndEncodedChunkWriter extends BaseChunkWriter<Chunk<Values>>
Serializes a flat column chunk as Arrow Run-End Encoded (REE) on the wire.

The REE parent array has logical length numRows, null_count 0, and zero buffers. It has two children:

  1. run_ends — a non-nullable Int16/Int32/Int64 array of numRuns cumulative 1-based end indices (last == numRows)
  2. values — the encoded value type of length numRuns, one representative value per run

Runs are computed over the selected subset. Consecutive equal values (including null == null) collapse into a single run.

  • Constructor Details

  • Method Details

    • 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<Chunk<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<Chunk<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