pub struct EncodedChunk {
pub frame: Bytes,
pub raw_len: usize,
pub rows: u32,
pub acks: AckSet,
pub oldest_ingest: Instant,
pub oldest_event_ms: i64,
}Expand description
A small frame of encoded rows produced on a pipeline thread, the unit shipped over the per-shard queues. Wire frames are concatenable, so workers accumulate chunks without re-encoding. A frame is one of three things:
- headerless rows appended back-to-back (RowBinary);
- one complete, self-describing block (ClickHouse Native);
- a unit the sink’s
FrameCodecmade from one of those, which decodes on its own.
In every case, frames concatenated in seal order form a legal body.
Teardown safety: acks is an AckSet. Dropping a chunk anywhere
(a closed queue, an aborted worker, a parked chunk at teardown) fails
its batches so their offsets never commit; only a completed durable
write delivers them.
Fields§
§frame: BytesEncoded rows in the sink’s wire format, after the sink’s
FrameCodec when it has one.
raw_len: usizeThe frame’s length as the encoder wrote it, before any codec. Equal
to frame.len() when the sink has no codec. The in-flight budget and
BatchConfig::max_bytes count this length.
rows: u32Number of rows in frame.
acks: AckSetAcknowledgment handles of the source batches represented in
frame. Consecutive records usually share a batch, so this stays
short (the encoder dedupes consecutive identical handles).
oldest_ingest: InstantWhen the oldest record in frame entered the terminal stage
(ingest-basis end-to-end latency).
oldest_event_ms: i64Smallest record event time in frame, milliseconds since the epoch
(event-basis end-to-end latency).