Expand description
§Databricks Zerobus Ingest SDK
A high-performance Rust client for streaming data ingestion into Databricks Delta tables.
§Quick Start
ⓘ
use databricks_zerobus_ingest_sdk::{ZerobusSdk, JsonValue};
let sdk = ZerobusSdk::builder()
.endpoint(zerobus_endpoint)
.unity_catalog_url(uc_endpoint)
.build()?;
let stream = sdk
.stream_builder()
.table("catalog.schema.table")
.oauth(client_id, client_secret)
.json()
.build()
.await?;
// Idiomatic flow: ingest in a loop, then flush() once to confirm the batch.
for my_record in records {
stream.ingest_record_offset(JsonValue(my_record)).await?;
}
stream.flush().await?; // Returns once every queued record is acknowledged.
stream.close().await?;See the examples/ directory for complete working examples.
Modules§
- databricks
- schema
- Convert a Unity Catalog table schema into a protobuf
DescriptorProto. - stream_
options - Shared configuration options for stream creation and operation.
- zeroparser
- Zero-copy, single-pass protobuf parser driven by a
prost_types::DescriptorProto.
Structs§
- Arrow
Schema - Describes the meta-data of an ordered sequence of relative types.
- Arrow
Stream Configuration Options - Configuration options for Arrow Flight stream creation and operation.
- Callback
Handler Harness - Test-only harness driving the real callback handler task and teardown
without a gRPC connection. Wires up the same
spawn_callback_handler_task+ channel asZerobusStream::new_stream, and itsteardown()runs the productionZerobusStream::shutdown_callback_task, so tests exercise the ack callback lifetime contract against real code. - Default
Token Factory - Default OAuth 2.0 token factory for Unity Catalog authentication.
- Field
- Describes a single column in a
Schema. - Json
String - Wrapper for pre-serialized JSON strings.
- Json
Value - Wrapper for JSON-serializable objects with automatic serialization.
- Message
Id - Opaque identifier returned by ingest methods on MultiplexedStream. Encodes the sub-stream index and sub-stream offset in a single i64.
- Multiplexed
Stream - Distributes ingestion round-robin across a fixed set of
ZerobusStreams. - NoAuth
Headers Provider - A headers provider that returns no headers.
- NoTls
Config - No-op TLS configuration for testing with plaintext
http://endpoints. - OAuth
Headers Provider - The default headers provider that uses OAuth 2.0 with Unity Catalog.
- Offset
IdGenerator - Generates monotonically increasing offset IDs for ingested records.
- Proto
Bytes - Wrapper for pre-serialized protobuf bytes.
- Proto
Message - Wrapper for protobuf messages with automatic serialization.
- Proxy
Connector - A proxy connector for the gRPC channel.
- Record
Batch - A two-dimensional batch of column-oriented data with a defined schema.
- Secure
TlsConfig - Secure TLS configuration using system CA certificates.
- Stream
Builder - A fluent builder for creating Zerobus ingestion streams.
- Stream
Configuration Options - Configuration options for stream creation, recovery of broken streams and flushing.
- Zerobus
Arrow Stream - An Arrow Flight stream for ingesting Arrow RecordBatches into a Delta table.
- Zerobus
Sdk - The main interface for interacting with the Zerobus API.
- Zerobus
SdkBuilder - Builder for creating a
ZerobusSdkinstance with fluent configuration. - Zerobus
Stream - Represents an active ingestion stream to a Databricks Delta table.
Enums§
- Data
Type - Datatypes supported by this implementation of Apache Arrow.
- Encoded
Batch - Encoded
Batch Iter - Encoded
Record - Stream
Type - The type of the stream connection created with the server. Currently we only support ephemeral streams on the server side, so we support only that in the SDK as well.
- Time
Unit - An absolute length of time in seconds, milliseconds, microseconds or nanoseconds.
- Zerobus
Error - Represents all possible errors that can occur when using Zerobus.
Constants§
- DEFAULT_
SDK_ IDENTIFIER - Default identifier the SDK sends as the HTTP
user-agentheader on every request. UseZerobusSdkBuilder::application_nameto append an application suffix.
Traits§
- AckCallback
- Callback trait for receiving acknowledgment notifications.
- Headers
Provider - A trait for providing custom headers for gRPC requests.
- TlsConfig
- Trait for TLS configuration strategies.
Type Aliases§
- Connector
Factory - Signature for caller-supplied proxy selection. Given the target host,
return a configured connector or
Nonefor a direct connection. - Json
Encoded Record - A type alias for a JSON-encoded record.
- Offset
Id - Offset ID type representing a logical (or physical) position in the stream.
- Proto
Encoded Record - A type alias for a protobuf-encoded record.
- Zerobus
Result