Skip to main content

Module view_registry

Module view_registry 

Source
Expand description

Shared Arc<ViewFactory> rebuilt from Postgres-backed view definitions on a timer, giving telemetry-maintenance-srv and flight-sql-srv a common, reloadable view of DDL-defined view sets without a restart. ViewRegistry: a shared Arc<ViewFactory> (the code-driven base plus every DDL-defined global view) rebuilt from lakehouse_view_set_definitions on a timer, so telemetry-maintenance-srv and flight-sql-srv both start reading/materializing a new or changed view set without a restart. Shaped after QueryDenyList: a Postgres-backed store, an immutable compiled snapshot behind a lock, a refresh/reload that logs and meters its own failures, and spawn_refresh_task.

Structs§

BuildFailure
A definition build_factory skipped, with the reason it was skipped, so a [BuildPurpose:: Probe] caller can name both in the error it raises.
ViewRegistry
A shared Arc<ViewFactory> (base + N DDL-defined SqlBatchViews) rebuilt from lakehouse_view_set_definitions on a timer. See the module doc comment.

Enums§

BuildPurpose
What a build_factory call is for, which decides how a skipped definition is reported.

Constants§

DEFAULT_REFRESH_SECONDS
Default value of MICROMEGAS_VIEW_DEFINITION_REFRESH_SECONDS.
MICROMEGAS_VIEW_DEFINITION_REFRESH_SECONDS
{prefix}-less env var: how often spawn_refresh_task calls reload(), and the bound on cross-replica propagation of a definition change made on a different node (the node that executed the DDL statement reloads inline instead, see rust/public/src/servers/view_ddl.rs).

Functions§

build_factory
Builds a factory from an explicit row set instead of store.list(), so a caller already holding rows inside an open transaction (the DDL executor’s dependent-protection check) can validate against them without a second, pool-backed read that would not see its own uncommitted write. reload() calls this too, after its own store.list(). async because building each row’s SqlBatchView is itself async and needs runtime/lake/ session_configurator to plan the extract query.