Skip to main content

Crate databricks_zerobus_ingest_sdk

Crate databricks_zerobus_ingest_sdk 

Source
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 mut 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§

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§

ArrowSchema
Describes the meta-data of an ordered sequence of relative types.
ArrowStreamConfigurationOptions
Configuration options for Arrow Flight stream creation and operation.
AvroBytes
Wrapper for a pre-encoded Avro binary datum (Beta).
AvroRecord
Wrapper for an Avro record the stream encodes against its writer schema (Beta).
BatchRecords
Records of one encoding held by an EncodedBatch.
BatchRecordsIntoIter
Owning iterator over BatchRecords.
BatchStats
Byte-size and count stats for an encoded batch.
CallbackHandlerHarness
Test-only harness driving the real callback handler task and teardown without a gRPC connection. Wires up the same spawn_callback_handler_task + channel as ZerobusStream::new_stream, and its teardown() runs the production ZerobusStream::shutdown_callback_task, so tests exercise the ack callback lifetime contract against real code.
ChannelExporter
A StatsExporter that forwards events to a bounded channel, dropping (and counting) events when the channel is full or closed so telemetry never blocks ingestion. Drain the paired receiver from channel_exporter.
DefaultTokenFactory
Default OAuth 2.0 token factory for Unity Catalog authentication.
DynamicMessage
DynamicMessage provides encoding, decoding and reflection of a protobuf message.
DynamicRecord
A protobuf record built field-by-field against a runtime MessageDescriptor, then encoded to wire bytes and ingested.
FederatedTokenProvider
A headers provider that federates an external IdP token into a Zerobus-scoped Databricks token via the RFC 8693 token-exchange grant.
Field
Describes a single column in a Schema.
GrpcStatus
A gRPC status that the Zerobus server or the SDK reports for a failed stream.
IdpTokenSupplier
A source of external IdP tokens, paired with a stable cache identity.
JsonString
Wrapper for pre-serialized JSON strings.
JsonValue
Wrapper for JSON-serializable objects with automatic serialization.
MessageDescriptor
A protobuf message definition.
MessageId
Opaque identifier returned by ingest methods on gRPC and Arrow mux streams. Encodes the sub-stream index and sub-stream offset in a single i64.
MultiplexedArrowStream
Distributes whole Arrow batches round-robin across Arrow Flight streams.
MultiplexedStream
Distributes ingestion round-robin across a fixed set of ZerobusStreams.
MultiplexedStreamBuilder
Terminal builder for a MultiplexedStream or an Arrow Flight mux.
NoAuthHeadersProvider
A headers provider that returns no headers.
NoTlsConfig
No-op TLS configuration for testing with plaintext http:// endpoints.
OAuthHeadersProvider
The default headers provider that uses OAuth 2.0 with Unity Catalog.
OffsetIdGenerator
Generates monotonically increasing offset IDs for ingested records.
PersistentStream
A durable, recoverable ingestion stream (Eos).
PersistentStreamBuilder
A fluent builder for creating or resuming persistent (Eos) streams.
ProtoBytes
Wrapper for pre-serialized protobuf bytes.
ProtoMessage
Wrapper for protobuf messages with automatic serialization.
ProxyConnector
A proxy connector for Zerobus gRPC transport channels, including Arrow Flight.
RecordBatch
A two-dimensional batch of column-oriented data with a defined schema.
SecureTlsConfig
Secure TLS configuration using system CA certificates.
StreamBuilder
A fluent builder for creating Zerobus ingestion streams.
StreamConfigurationOptions
Configuration options for stream creation, recovery of broken streams and flushing.
TlsSettings
Describes the TLS setup of a gRPC channel.
ZerobusArrowStream
An Arrow Flight stream for ingesting Arrow RecordBatches into a Delta table.
ZerobusSdk
The main interface for interacting with the Zerobus API.
ZerobusSdkBuilder
Builder for creating a ZerobusSdk instance with fluent configuration.
ZerobusStream
Represents an active ingestion stream to a Databricks Delta table.

Enums§

ArrowCompression
Compression for Arrow Flight payloads.
ArrowDictionaryHandling
How an Arrow Flight stream sends dictionary-encoded columns.
AvroValue
A valid Avro value.
DataType
Datatypes supported by this implementation of Apache Arrow.
EncodedBatch
EncodedBatchIter
EncodedRecord
GrpcCode
A gRPC status code.
ReconnectReason
Why a stream reconnected.
RecordType
Record encoding of a JSON, Protocol Buffers, or Avro stream.
SchemaValidationCause
A machine-readable cause of a schema-validation rejection, reported by the server in the gRPC ErrorInfo metadata (as stable string tokens) and decoded here into typed variants.
StreamStat
A telemetry event emitted by a stream. Owned and Clone, so an event can be forwarded across a channel directly (see ChannelExporter). Not Copy or Eq — Reconnected carries a ZerobusError, which is neither.
StreamType
The type of the stream connection created with the server.
TimeUnit
An absolute length of time in seconds, milliseconds, microseconds or nanoseconds.
Value
A dynamically-typed protobuf value.
ZerobusError
Represents all possible errors that can occur when using Zerobus.

Constants§

DEFAULT_SDK_IDENTIFIER
Default identifier the SDK sends as the HTTP user-agent header on every request. Use ZerobusSdkBuilder::application_name to append an application suffix.

Traits§

AckCallback
Callback trait for receiving acknowledgment notifications.
HeadersProvider
A trait for providing custom headers for gRPC requests.
IntoDynamicValue
Converts a Rust type into a protobuf Value for DynamicRecord::set.
StatsExporter
Sink for stream telemetry. Register with .stats_exporter(...) on the builder.
TlsConfig
Trait for TLS configuration strategies.

Functions§

channel_exporter
Creates a ChannelExporter with a bounded buffer of capacity events and returns it with the receiver to drain concurrently. NonZeroUsize prevents a zero-capacity channel. The receiver ends after all exporter clones, including those owned by streams and their IO tasks, are dropped and queued events are drained.
message_descriptor
Resolve a MessageDescriptor from a prost_types::DescriptorProto, to pass to StreamBuilder::dynamic_proto.
missing_required_fields
Full paths of any proto2 required fields absent from message, descending into nested messages, list elements, and map values. Empty if none are missing. prost-reflect follows proto3 semantics and does not enforce this on encode, so callers check it before sending records the server would reject.

Type Aliases§

AvroEncodedRecord
A type alias for an Avro-encoded record.
ConnectorFactory
Signature for caller-supplied proxy selection. Given the target host, return a configured connector or None for a direct connection.
IdpTokenCallback
An async callback that yields the current external IdP token (for example an Entra ID / OIDC JWT).
JsonEncodedRecord
A type alias for a JSON-encoded record.
OffsetId
Offset ID type representing a logical (or physical) position in the stream.
ProtoEncodedRecord
A type alias for a protobuf-encoded record.
ZerobusResult