Expand description
ClickHouse writer with bounded-channel backpressure.
ClickHouseWriter runs a background thread that receives Arrow
RecordBatch values over a bounded
sync_channel, serializes them to Arrow IPC stream format, and POSTs
them to ClickHouse via HTTP.
§Backpressure
The bounded channel blocks the sender when the buffer is full, preventing the simulation from outrunning the writer.
§Delivery semantics
Delivery is tracked in three stages:
- accepted into the writer channel
- successfully sent to ClickHouse
- dropped after all retries are exhausted
The writer exposes both live snapshots and final shutdown statistics so callers can distinguish enqueue success from durable delivery success.
§Retry
Failed HTTP requests are retried with exponential backoff and full jitter:
delay = random(0, min(max_retry_delay, base_retry_delay x 2^(attempt-1)))Structs§
- Click
House Config - Configuration for the ClickHouse writer.
- Click
House Writer - Background ClickHouse writer with bounded-channel backpressure.
- Writer
Metrics Snapshot - Live snapshot of background-writer metrics.
- Writer
Stats - Statistics from the writer’s lifetime.
Enums§
- Click
House Error - Errors that can occur in the ClickHouse writer.
- Writer
Message - Message type for the writer channel.