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>>
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:
run_ends— a non-nullable Int16/Int32/Int64 array ofnumRunscumulative 1-based end indices (last == numRows)values— the encoded value type of lengthnumRuns, one representative value per run
Runs are computed over the selected subset. Consecutive equal values (including null == null) collapse into a single run.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.deephaven.extensions.barrage.chunk.BaseChunkWriter
BaseChunkWriter.ChunkTransformer<SOURCE_CHUNK_TYPE extends Chunk<Values>>, BaseChunkWriter.SerContextNested classes/interfaces inherited from interface io.deephaven.extensions.barrage.chunk.ChunkWriter
ChunkWriter.BufferListener, ChunkWriter.Context, ChunkWriter.DrainableColumn, ChunkWriter.Factory, ChunkWriter.FieldNodeInfo, ChunkWriter.FieldNodeListener -
Field Summary
Fields inherited from class io.deephaven.extensions.barrage.chunk.BaseChunkWriter
BULK_WRITE_BUFFER_BYTES, dhNullable, elementSize, fieldNullable, PADDING_BUFFER, REMAINDER_MOD_8_MASK -
Constructor Summary
ConstructorsConstructorDescriptionRunEndEncodedChunkWriter(@NotNull ChunkWriter<IntChunk<Values>> runEndsWriter, @NotNull ChunkWriter<Chunk<Values>> valuesWriter, @NotNull ChunkType runEndsChunkType, @NotNull ChunkType valuesChunkType, boolean fieldNullable) -
Method Summary
Modifier and TypeMethodDescriptionprotected intcomputeNullCount(ChunkWriter.Context context, @NotNull RowSequence subset) Compute the number of nulls in the subset.getInputStream(ChunkWriter.Context context, @Nullable RowSet subset, @NotNull BarrageOptions options) Get an input stream optionally position-space filtered using the provided RowSet.getInputStream(ChunkWriter.Context context, @Nullable RowSet subset, @NotNull BarrageOptions options, @Nullable DictionaryWriterRegistry dictionaryRegistry) Get an input stream, threading aDictionaryWriterRegistrydown to any dictionary-encoded writers nested within this writer (e.g.protected voidwriteValidityBufferInternal(ChunkWriter.Context context, @NotNull RowSequence subset, @NotNull BaseChunkWriter.SerContext serContext) Update the validity buffer for the subset.Methods inherited from class io.deephaven.extensions.barrage.chunk.BaseChunkWriter
getEmptyInputStream, getEmptyInputStream, getNumLongsForBitPackOfSize, getValidityMapSerializationSizeFor, isFieldNullable, makeContext
-
Constructor Details
-
RunEndEncodedChunkWriter
public RunEndEncodedChunkWriter(@NotNull @NotNull ChunkWriter<IntChunk<Values>> runEndsWriter, @NotNull @NotNull ChunkWriter<Chunk<Values>> valuesWriter, @NotNull @NotNull ChunkType runEndsChunkType, @NotNull @NotNull ChunkType valuesChunkType, boolean fieldNullable)
-
-
Method Details
-
computeNullCount
protected int computeNullCount(@NotNull ChunkWriter.Context context, @NotNull @NotNull RowSequence subset) Description copied from class:BaseChunkWriterCompute the number of nulls in the subset.- Specified by:
computeNullCountin classBaseChunkWriter<Chunk<Values>>- Parameters:
context- the context for the chunksubset- 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:BaseChunkWriterUpdate the validity buffer for the subset.- Specified by:
writeValidityBufferInternalin classBaseChunkWriter<Chunk<Values>>- Parameters:
context- the context for the chunksubset- the subset of rows to considerserContext- 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:ChunkWriterGet 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 clientsubset- if provided, is a position-space filter of source dataoptions- 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 aDictionaryWriterRegistrydown to any dictionary-encoded writers nested within this writer (e.g. thevalueschild of a run-end-encoded column). Writers that contain no dictionary encoding ignore the registry and behave identically toChunkWriter.getInputStream(Context, RowSet, BarrageOptions).A
DictionaryChunkWriteruses the registry to obtain (and register) its per-idDictionaryWriterState, so that the enclosing message writer emits the correspondingDictionaryBatch. Composite writers forward the registry to their children.Forwards
dictionaryRegistryto thevalueschild writer so that a dictionary-encoded values child (yielding aRunEndEncoded<Dictionary<...>>column) can resolve and register its dictionary state. Therun_endschild is never dictionary-encoded, so it ignores the registry.- Parameters:
context- the chunk writer context holding the data to be drained to the clientsubset- if provided, is a position-space filter of source dataoptions- options for writing to the streamdictionaryRegistry- the per-stream dictionary registry; may benullwhen 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
-