pub struct SchemaRegistry { /* private fields */ }Expand description
Runtime registry: by-name and by-hash lookup populated from the
linkme distributed slice at observer init. Owned by
StandardObserver; sinks receive Arc<SchemaRegistry> at
construction.
Implementations§
Source§impl SchemaRegistry
impl SchemaRegistry
Sourcepub fn from_link_section() -> Self
pub fn from_link_section() -> Self
Walk EVENT_SCHEMAS and assemble the runtime registry. Called
once at StandardObserver::build(). Spec 14 § 4.
Detects schema_hash collisions (two distinct events that
happen to share the same first-8-byte BLAKE3 prefix) and emits
obs.runtime.v1.ObsCallsiteHashCollision once per collision.
Spec 14 § 8 row 2 / spec 31 § 10 / spec 93 P2-9.
Sourcepub fn arrow_schema(&self) -> Arc<ArrowSchemaModel> ⓘ
pub fn arrow_schema(&self) -> Arc<ArrowSchemaModel> ⓘ
The unified Arrow schema model assembled at registry init.
Used by ParquetSink::from_registry, ClickHouseSink DDL emit,
and the CLI’s obs migrate {parquet,clickhouse} paths.
Spec 14 § 4 KD5.
Sourcepub fn lookup(
&self,
env: &ObsEnvelope,
) -> Option<&'static dyn EventSchemaErased>
pub fn lookup( &self, env: &ObsEnvelope, ) -> Option<&'static dyn EventSchemaErased>
Hot-path lookup: try schema_hash first (8-byte u64), then
fall back to full_name for foreign-producer interop.
Spec 14 § 4.1.
Sourcepub fn lookup_by_full_name(
&self,
full_name: &str,
) -> Option<&'static dyn EventSchemaErased>
pub fn lookup_by_full_name( &self, full_name: &str, ) -> Option<&'static dyn EventSchemaErased>
Lookup by full_name only (no schema_hash dispatch). Used by
the per-event Struct dispatch in obs-parquet’s record-batch
builder: callers walk a registry-backed column array and need
the raw schema for the matching event without an envelope to
hand. Spec 94 § 2.8.
Sourcepub fn iter(&self) -> impl Iterator<Item = &'static dyn EventSchemaErased> + '_
pub fn iter(&self) -> impl Iterator<Item = &'static dyn EventSchemaErased> + '_
Iterate all registered schemas (used by obs schema show,
obs migrate, the bridge pre-warm path).
Trait Implementations§
Source§impl Clone for SchemaRegistry
impl Clone for SchemaRegistry
Source§fn clone(&self) -> SchemaRegistry
fn clone(&self) -> SchemaRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more