Struct mz_adapter::catalog::state::CatalogState
source · pub struct CatalogState {Show 26 fields
pub(super) database_by_name: BTreeMap<String, DatabaseId>,
pub(super) database_by_id: BTreeMap<DatabaseId, Database>,
pub(super) entry_by_id: BTreeMap<CatalogItemId, CatalogEntry>,
pub(super) entry_by_global_id: BTreeMap<GlobalId, CatalogItemId>,
pub(super) ambient_schemas_by_name: BTreeMap<String, SchemaId>,
pub(super) ambient_schemas_by_id: BTreeMap<SchemaId, Schema>,
pub(super) clusters_by_name: BTreeMap<String, ClusterId>,
pub(super) clusters_by_id: BTreeMap<ClusterId, Cluster>,
pub(super) roles_by_name: BTreeMap<String, RoleId>,
pub(super) roles_by_id: BTreeMap<RoleId, Role>,
pub(super) network_policies_by_name: BTreeMap<String, NetworkPolicyId>,
pub(super) network_policies_by_id: BTreeMap<NetworkPolicyId, NetworkPolicy>,
pub(super) system_configuration: SystemVars,
pub(super) default_privileges: DefaultPrivileges,
pub(super) system_privileges: PrivilegeMap,
pub(super) comments: CommentsMap,
pub(super) source_references: BTreeMap<CatalogItemId, SourceReferences>,
pub(super) storage_metadata: StorageMetadata,
pub(super) temporary_schemas: BTreeMap<ConnectionId, Schema>,
pub(super) config: CatalogConfig,
pub(super) cluster_replica_sizes: ClusterReplicaSizeMap,
pub(crate) availability_zones: Vec<String>,
pub(super) egress_addresses: Vec<IpNet>,
pub(super) aws_principal_context: Option<AwsPrincipalContext>,
pub(super) aws_privatelink_availability_zones: Option<BTreeSet<String>>,
pub(super) http_host_name: Option<String>,
}
Expand description
The in-memory representation of the Catalog. This struct is not directly used to persist
metadata to persistent storage. For persistent metadata see
mz_catalog::durable::DurableCatalogState
.
Serialize
is implemented to create human readable dumps of the in-memory state, not for
storing the contents of this struct on disk.
Fields§
§database_by_name: BTreeMap<String, DatabaseId>
§database_by_id: BTreeMap<DatabaseId, Database>
§entry_by_id: BTreeMap<CatalogItemId, CatalogEntry>
§entry_by_global_id: BTreeMap<GlobalId, CatalogItemId>
§ambient_schemas_by_name: BTreeMap<String, SchemaId>
§ambient_schemas_by_id: BTreeMap<SchemaId, Schema>
§clusters_by_name: BTreeMap<String, ClusterId>
§clusters_by_id: BTreeMap<ClusterId, Cluster>
§roles_by_name: BTreeMap<String, RoleId>
§roles_by_id: BTreeMap<RoleId, Role>
§network_policies_by_name: BTreeMap<String, NetworkPolicyId>
§network_policies_by_id: BTreeMap<NetworkPolicyId, NetworkPolicy>
§system_configuration: SystemVars
§default_privileges: DefaultPrivileges
§system_privileges: PrivilegeMap
§comments: CommentsMap
§source_references: BTreeMap<CatalogItemId, SourceReferences>
§storage_metadata: StorageMetadata
§temporary_schemas: BTreeMap<ConnectionId, Schema>
§config: CatalogConfig
§cluster_replica_sizes: ClusterReplicaSizeMap
§availability_zones: Vec<String>
§egress_addresses: Vec<IpNet>
§aws_principal_context: Option<AwsPrincipalContext>
§aws_privatelink_availability_zones: Option<BTreeSet<String>>
§http_host_name: Option<String>
Implementations§
source§impl CatalogState
impl CatalogState
sourcepub(crate) fn pack_optimizer_notices<'a>(
&self,
updates: &mut Vec<BuiltinTableUpdate>,
notices: impl Iterator<Item = &'a Arc<OptimizerNotice>>,
diff: Diff,
)
pub(crate) fn pack_optimizer_notices<'a>( &self, updates: &mut Vec<BuiltinTableUpdate>, notices: impl Iterator<Item = &'a Arc<OptimizerNotice>>, diff: Diff, )
Pack a BuiltinTableUpdate
with the given diff
for each
OptimizerNotice
in notices
into updates
.
source§impl CatalogState
impl CatalogState
pub fn resolve_builtin_table_updates( &self, builtin_table_update: Vec<BuiltinTableUpdate<&'static BuiltinTable>>, ) -> Vec<BuiltinTableUpdate<CatalogItemId>>
pub fn resolve_builtin_table_update( &self, _: BuiltinTableUpdate<&'static BuiltinTable>, ) -> BuiltinTableUpdate<CatalogItemId>
pub fn pack_depends_update( &self, depender: CatalogItemId, dependee: CatalogItemId, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub(super) fn pack_database_update( &self, database_id: &DatabaseId, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub(super) fn pack_schema_update( &self, database_spec: &ResolvedDatabaseSpecifier, schema_id: &SchemaId, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub(super) fn pack_role_update( &self, id: RoleId, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub(super) fn pack_role_members_update( &self, role_id: RoleId, member_id: RoleId, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub(super) fn pack_cluster_update( &self, name: &str, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub(super) fn pack_cluster_replica_update( &self, cluster_id: ClusterId, name: &str, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub(crate) fn pack_cluster_replica_status_update( &self, replica_id: ReplicaId, process_id: ProcessId, event: &ClusterReplicaProcessStatus, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub(crate) fn pack_network_policy_update( &self, policy_id: &NetworkPolicyId, diff: Diff, ) -> Result<Vec<BuiltinTableUpdate<&'static BuiltinTable>>, Error>
pub(super) fn pack_item_update( &self, id: CatalogItemId, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_history_retention_strategy_update( &self, id: CatalogItemId, cw: CompactionWindow, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
fn pack_table_update( &self, id: CatalogItemId, oid: u32, schema_id: &SchemaSpecifier, name: &str, owner_id: &RoleId, privileges: Datum<'_>, diff: Diff, table: &Table, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_source_update( &self, id: CatalogItemId, oid: u32, schema_id: &SchemaSpecifier, name: &str, source_desc_name: &str, connection_id: Option<CatalogItemId>, envelope: Option<&str>, key_format: Option<&str>, value_format: Option<&str>, cluster_id: Option<&str>, owner_id: &RoleId, privileges: Datum<'_>, diff: Diff, create_sql: Option<&String>, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_postgres_source_update( &self, id: CatalogItemId, postgres: &PostgresSourceConnection<ReferencedConnection>, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_kafka_source_update( &self, item_id: CatalogItemId, collection_id: GlobalId, kafka: &KafkaSourceConnection<ReferencedConnection>, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_postgres_source_tables_update( &self, id: CatalogItemId, schema_name: &str, table_name: &str, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_mysql_source_tables_update( &self, id: CatalogItemId, schema_name: &str, table_name: &str, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_kafka_source_tables_update( &self, id: CatalogItemId, topic: &str, envelope: Option<&str>, key_format: Option<&str>, value_format: Option<&str>, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_connection_update( &self, id: CatalogItemId, oid: u32, schema_id: &SchemaSpecifier, name: &str, owner_id: &RoleId, privileges: Datum<'_>, connection: &Connection, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub(crate) fn pack_ssh_tunnel_connection_update( &self, id: CatalogItemId, key_1: &SshKey, key_2: &SshKey, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
fn pack_kafka_connection_update( &self, id: CatalogItemId, kafka: &KafkaConnection<ReferencedConnection>, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub fn pack_aws_privatelink_connection_update( &self, connection_id: CatalogItemId, aws_principal_context: &AwsPrincipalContext, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub fn pack_aws_connection_update( &self, connection_id: CatalogItemId, aws_config: &AwsConnection, diff: Diff, ) -> Result<BuiltinTableUpdate<&'static BuiltinTable>, Error>
fn pack_view_update( &self, id: CatalogItemId, oid: u32, schema_id: &SchemaSpecifier, name: &str, owner_id: &RoleId, privileges: Datum<'_>, view: &View, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_materialized_view_update( &self, id: CatalogItemId, oid: u32, schema_id: &SchemaSpecifier, name: &str, owner_id: &RoleId, privileges: Datum<'_>, mview: &MaterializedView, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_continual_task_update( &self, id: CatalogItemId, oid: u32, schema_id: &SchemaSpecifier, name: &str, owner_id: &RoleId, privileges: Datum<'_>, ct: &ContinualTask, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_sink_update( &self, id: CatalogItemId, oid: u32, schema_id: &SchemaSpecifier, name: &str, owner_id: &RoleId, sink: &Sink, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_index_update( &self, id: CatalogItemId, oid: u32, name: &str, owner_id: &RoleId, index: &Index, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_type_update( &self, id: CatalogItemId, oid: u32, schema_id: &SchemaSpecifier, name: &str, owner_id: &RoleId, privileges: Datum<'_>, typ: &Type, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
fn pack_func_update( &self, id: CatalogItemId, schema_id: &SchemaSpecifier, name: &str, owner_id: &RoleId, func: &Func, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub fn pack_op_update( &self, operator: &str, func_impl_details: FuncImplCatalogDetails, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
fn pack_secret_update( &self, id: CatalogItemId, oid: u32, schema_id: &SchemaSpecifier, name: &str, owner_id: &RoleId, privileges: Datum<'_>, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub fn pack_audit_log_update( &self, event: &VersionedEvent, diff: Diff, ) -> Result<BuiltinTableUpdate<&'static BuiltinTable>, Error>
pub fn pack_storage_usage_update( &self, VersionedStorageUsage::V1: VersionedStorageUsage, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub fn pack_egress_ip_update( &self, ip: &IpNet, ) -> Result<BuiltinTableUpdate<&'static BuiltinTable>, Error>
pub fn pack_replica_metric_updates( &self, replica_id: ReplicaId, updates: &[ServiceProcessMetrics], diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub fn pack_all_replica_size_updates( &self, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub fn pack_subscribe_update( &self, id: GlobalId, subscribe: &ActiveSubscribe, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub fn pack_session_update( &self, conn: &ConnMeta, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub fn pack_default_privileges_update( &self, default_privilege_object: &DefaultPrivilegeObject, grantee: &RoleId, acl_mode: &AclMode, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub fn pack_system_privileges_update( &self, privileges: MzAclItem, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
fn pack_privilege_array_row(&self, privileges: &PrivilegeMap) -> Row
pub fn pack_comment_update( &self, object_id: CommentObjectId, column_pos: Option<usize>, comment: &str, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub fn pack_webhook_source_update( &self, item_id: CatalogItemId, diff: Diff, ) -> BuiltinTableUpdate<&'static BuiltinTable>
pub fn pack_source_references_update( &self, source_references: &SourceReferences, diff: Diff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
source§impl CatalogState
impl CatalogState
sourcepub fn check_consistency(&self) -> Result<(), Box<CatalogInconsistencies>>
pub fn check_consistency(&self) -> Result<(), Box<CatalogInconsistencies>>
Checks the CatalogState
to make sure we’re internally consistent.
sourcefn check_internal_fields(&self) -> Result<(), Vec<InternalFieldsInconsistency>>
fn check_internal_fields(&self) -> Result<(), Vec<InternalFieldsInconsistency>>
§Invariants:
- Any fields within
CatalogState
that reference another field need to be kept in sync.
TODO(parkmycar): Check the reverse direction for these collections, e.g. all of the
DatabaseId
s in database_by_id
also exist in database_by_name
.
sourcefn check_roles(&self) -> Result<(), Vec<RoleInconsistency>>
fn check_roles(&self) -> Result<(), Vec<RoleInconsistency>>
§Invariants:
- All RoleIds referenced from other objects must exist.
sourcefn check_comments(&self) -> Result<(), Vec<CommentInconsistency>>
fn check_comments(&self) -> Result<(), Vec<CommentInconsistency>>
§Invariants:
- Comments should only reference existing objects.
- A comment should only have a column position if it references a relation.
sourcefn check_object_dependencies(
&self,
) -> Result<(), Vec<ObjectDependencyInconsistency>>
fn check_object_dependencies( &self, ) -> Result<(), Vec<ObjectDependencyInconsistency>>
§Invariants:
- All of the objects in the “uses” collection of a CatalogEntry, should contain said CatalogEntry in their own “used_by” collection.
- All of the objects in the “used_by” collection of a CatalogEntry, should contain said CatalogEntry in their own “uses” collection.
sourcefn check_items(&self) -> Result<(), Vec<ItemInconsistency>>
fn check_items(&self) -> Result<(), Vec<ItemInconsistency>>
§Invariants
- Every schema that exists in the
schemas_by_name
map, also exists inschemas_by_id
. - The name present in the
schemas_by_name
map matches the name in the associatedSchema
struct. - All items that exist in a
Schema
struct, also exist in theentries_by_id
map. - Parsing the
create_sql
string from anEntry
succeeds. - The result of parsing the
create_sql
must return a singleStatement
. - The names in the returned
Statement
, must match that of the parent struct. - The item from the parsed
create_sql
must be fully qualified.
source§impl CatalogState
impl CatalogState
sourcepub(crate) async fn apply_updates_for_bootstrap(
&mut self,
updates: Vec<StateUpdate>,
local_expression_cache: &mut LocalExpressionCache,
) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub(crate) async fn apply_updates_for_bootstrap( &mut self, updates: Vec<StateUpdate>, local_expression_cache: &mut LocalExpressionCache, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
Update in-memory catalog state from a list of updates made to the durable catalog state.
Returns builtin table updates corresponding to the changes to catalog state.
This is meant specifically for bootstrapping because it batches and applies builtin view additions separately from other update types.
sourcepub(crate) fn apply_updates(
&mut self,
updates: Vec<StateUpdate>,
) -> Result<Vec<BuiltinTableUpdate<&'static BuiltinTable>>, CatalogError>
pub(crate) fn apply_updates( &mut self, updates: Vec<StateUpdate>, ) -> Result<Vec<BuiltinTableUpdate<&'static BuiltinTable>>, CatalogError>
Update in-memory catalog state from a list of updates made to the durable catalog state.
Returns builtin table updates corresponding to the changes to catalog state.
fn apply_updates_inner( &mut self, updates: Vec<StateUpdate>, retractions: &mut InProgressRetractions, local_expression_cache: &mut LocalExpressionCache, ) -> Result<Vec<BuiltinTableUpdate<&'static BuiltinTable>>, CatalogError>
fn apply_update( &mut self, kind: StateUpdateKind, diff: StateDiff, retractions: &mut InProgressRetractions, local_expression_cache: &mut LocalExpressionCache, ) -> Result<(), CatalogError>
fn apply_role_update( &mut self, role: Role, diff: StateDiff, retractions: &mut InProgressRetractions, )
fn apply_database_update( &mut self, database: Database, diff: StateDiff, retractions: &mut InProgressRetractions, )
fn apply_schema_update( &mut self, schema: Schema, diff: StateDiff, retractions: &mut InProgressRetractions, )
fn apply_default_privilege_update( &mut self, default_privilege: DefaultPrivilege, diff: StateDiff, _retractions: &mut InProgressRetractions, )
fn apply_system_privilege_update( &mut self, system_privilege: MzAclItem, diff: StateDiff, _retractions: &mut InProgressRetractions, )
fn apply_system_configuration_update( &mut self, system_configuration: SystemConfiguration, diff: StateDiff, _retractions: &mut InProgressRetractions, )
fn apply_cluster_update( &mut self, cluster: Cluster, diff: StateDiff, retractions: &mut InProgressRetractions, )
fn apply_network_policy_update( &mut self, policy: NetworkPolicy, diff: StateDiff, retractions: &mut InProgressRetractions, )
fn apply_introspection_source_index_update( &mut self, introspection_source_index: IntrospectionSourceIndex, diff: StateDiff, retractions: &mut InProgressRetractions, )
fn apply_cluster_replica_update( &mut self, cluster_replica: ClusterReplica, diff: StateDiff, _retractions: &mut InProgressRetractions, )
fn apply_system_object_mapping_update( &mut self, system_object_mapping: SystemObjectMapping, diff: StateDiff, retractions: &mut InProgressRetractions, local_expression_cache: &mut LocalExpressionCache, )
fn apply_temporary_item_update( &mut self, _: TemporaryItem, diff: StateDiff, retractions: &mut InProgressRetractions, )
fn apply_item_update( &mut self, item: Item, diff: StateDiff, retractions: &mut InProgressRetractions, local_expression_cache: &mut LocalExpressionCache, ) -> Result<(), CatalogError>
fn apply_comment_update( &mut self, comment: Comment, diff: StateDiff, _retractions: &mut InProgressRetractions, )
fn apply_source_references_update( &mut self, source_references: SourceReferences, diff: StateDiff, _retractions: &mut InProgressRetractions, )
fn apply_storage_collection_metadata_update( &mut self, storage_collection_metadata: StorageCollectionMetadata, diff: StateDiff, _retractions: &mut InProgressRetractions, )
fn apply_unfinalized_shard_update( &mut self, unfinalized_shard: UnfinalizedShard, diff: StateDiff, _retractions: &mut InProgressRetractions, )
sourcepub(crate) fn generate_builtin_table_updates(
&self,
updates: Vec<StateUpdate>,
) -> Vec<BuiltinTableUpdate>
pub(crate) fn generate_builtin_table_updates( &self, updates: Vec<StateUpdate>, ) -> Vec<BuiltinTableUpdate>
Generate a list of BuiltinTableUpdate
s that correspond to a list of updates made to the
durable catalog.
sourcepub(crate) fn generate_builtin_table_update(
&self,
kind: StateUpdateKind,
diff: StateDiff,
) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
pub(crate) fn generate_builtin_table_update( &self, kind: StateUpdateKind, diff: StateDiff, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
Generate a list of BuiltinTableUpdate
s that correspond to a single update made to the
durable catalog.
fn get_entry_mut(&mut self, id: &CatalogItemId) -> &mut CatalogEntry
fn get_schema_mut( &mut self, database_spec: &ResolvedDatabaseSpecifier, schema_spec: &SchemaSpecifier, conn_id: &ConnectionId, ) -> &mut Schema
sourceasync fn parse_builtin_views(
state: &mut CatalogState,
builtin_views: Vec<(&'static BuiltinView, CatalogItemId, GlobalId)>,
retractions: &mut InProgressRetractions,
local_expression_cache: &mut LocalExpressionCache,
) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
async fn parse_builtin_views( state: &mut CatalogState, builtin_views: Vec<(&'static BuiltinView, CatalogItemId, GlobalId)>, retractions: &mut InProgressRetractions, local_expression_cache: &mut LocalExpressionCache, ) -> Vec<BuiltinTableUpdate<&'static BuiltinTable>>
Install builtin views to the catalog. This is its own function so that views can be optimized in parallel.
The implementation is similar to apply_updates_for_bootstrap
and determines dependency
problems by sniffing out specific errors and then retrying once those dependencies are
complete. This doesn’t work for everything (casts, function implementations) so we also need
to have a bucket for everything at the end. Additionally, because this executes in parellel,
we must maintain a completed set otherwise races could result in orphaned views languishing
in awaiting with nothing retriggering the attempt.
sourcefn insert_entry(&mut self, entry: CatalogEntry)
fn insert_entry(&mut self, entry: CatalogEntry)
Associates a name, CatalogItemId
, and entry.
sourcefn insert_item(
&mut self,
id: CatalogItemId,
oid: u32,
name: QualifiedItemName,
item: CatalogItem,
owner_id: RoleId,
privileges: PrivilegeMap,
)
fn insert_item( &mut self, id: CatalogItemId, oid: u32, name: QualifiedItemName, item: CatalogItem, owner_id: RoleId, privileges: PrivilegeMap, )
Associates a name, CatalogItemId
, and entry.
fn drop_item(&mut self, id: CatalogItemId) -> CatalogEntry
fn insert_introspection_source_index( &mut self, cluster_id: ClusterId, log: &'static BuiltinLog, item_id: CatalogItemId, global_id: GlobalId, oid: u32, )
source§impl CatalogState
impl CatalogState
source§impl CatalogState
impl CatalogState
sourcepub fn empty_test() -> Self
pub fn empty_test() -> Self
Returns an empty CatalogState
that can be used in tests.
pub fn for_session<'a>(&'a self, session: &'a Session) -> ConnCatalog<'a>
pub fn for_sessionless_user(&self, role_id: RoleId) -> ConnCatalog<'_>
pub fn for_system_session(&self) -> ConnCatalog<'_>
sourcepub fn transitive_uses(
&self,
id: CatalogItemId,
) -> impl Iterator<Item = CatalogItemId> + '_
pub fn transitive_uses( &self, id: CatalogItemId, ) -> impl Iterator<Item = CatalogItemId> + '_
Returns an iterator over the deduplicated identifiers of all
objects this catalog entry transitively depends on (where
“depends on” is meant in the sense of CatalogItem::uses
, rather than
CatalogItem::references
).
sourcepub fn introspection_dependencies(
&self,
id: CatalogItemId,
) -> Vec<CatalogItemId>
pub fn introspection_dependencies( &self, id: CatalogItemId, ) -> Vec<CatalogItemId>
Computes the IDs of any log sources this catalog entry transitively depends on.
fn introspection_dependencies_inner( &self, id: CatalogItemId, out: &mut Vec<CatalogItemId>, )
sourcepub(super) fn object_dependents(
&self,
object_ids: &Vec<ObjectId>,
conn_id: &ConnectionId,
seen: &mut BTreeSet<ObjectId>,
) -> Vec<ObjectId>
pub(super) fn object_dependents( &self, object_ids: &Vec<ObjectId>, conn_id: &ConnectionId, seen: &mut BTreeSet<ObjectId>, ) -> Vec<ObjectId>
Returns all the IDs of all objects that depend on ids
, including ids
themselves.
The order is guaranteed to be in reverse dependency order, i.e. the leafs will appear earlier in the list than the roots. This is particularly useful for the order to drop objects.
sourcefn cluster_dependents(
&self,
cluster_id: ClusterId,
seen: &mut BTreeSet<ObjectId>,
) -> Vec<ObjectId>
fn cluster_dependents( &self, cluster_id: ClusterId, seen: &mut BTreeSet<ObjectId>, ) -> Vec<ObjectId>
Returns all the IDs of all objects that depend on cluster_id
, including cluster_id
itself.
The order is guaranteed to be in reverse dependency order, i.e. the leafs will appear earlier in the list than the roots. This is particularly useful for the order to drop objects.
sourcepub(super) fn cluster_replica_dependents(
&self,
cluster_id: ClusterId,
replica_id: ReplicaId,
seen: &mut BTreeSet<ObjectId>,
) -> Vec<ObjectId>
pub(super) fn cluster_replica_dependents( &self, cluster_id: ClusterId, replica_id: ReplicaId, seen: &mut BTreeSet<ObjectId>, ) -> Vec<ObjectId>
Returns all the IDs of all objects that depend on replica_id
, including replica_id
itself.
The order is guaranteed to be in reverse dependency order, i.e. the leafs will appear earlier in the list than the roots. This is particularly useful for the order to drop objects.
sourcefn database_dependents(
&self,
database_id: DatabaseId,
conn_id: &ConnectionId,
seen: &mut BTreeSet<ObjectId>,
) -> Vec<ObjectId>
fn database_dependents( &self, database_id: DatabaseId, conn_id: &ConnectionId, seen: &mut BTreeSet<ObjectId>, ) -> Vec<ObjectId>
Returns all the IDs of all objects that depend on database_id
, including database_id
itself.
The order is guaranteed to be in reverse dependency order, i.e. the leafs will appear earlier in the list than the roots. This is particularly useful for the order to drop objects.
sourcefn schema_dependents(
&self,
database_spec: ResolvedDatabaseSpecifier,
schema_spec: SchemaSpecifier,
conn_id: &ConnectionId,
seen: &mut BTreeSet<ObjectId>,
) -> Vec<ObjectId>
fn schema_dependents( &self, database_spec: ResolvedDatabaseSpecifier, schema_spec: SchemaSpecifier, conn_id: &ConnectionId, seen: &mut BTreeSet<ObjectId>, ) -> Vec<ObjectId>
Returns all the IDs of all objects that depend on schema_id
, including schema_id
itself.
The order is guaranteed to be in reverse dependency order, i.e. the leafs will appear earlier in the list than the roots. This is particularly useful for the order to drop objects.
sourcepub(super) fn item_dependents(
&self,
item_id: CatalogItemId,
seen: &mut BTreeSet<ObjectId>,
) -> Vec<ObjectId>
pub(super) fn item_dependents( &self, item_id: CatalogItemId, seen: &mut BTreeSet<ObjectId>, ) -> Vec<ObjectId>
Returns all the IDs of all objects that depend on item_id
, including item_id
itself.
The order is guaranteed to be in reverse dependency order, i.e. the leafs will appear earlier in the list than the roots. This is particularly useful for the order to drop objects.
sourcepub(super) fn network_policy_dependents(
&self,
network_policy_id: NetworkPolicyId,
_seen: &mut BTreeSet<ObjectId>,
) -> Vec<ObjectId>
pub(super) fn network_policy_dependents( &self, network_policy_id: NetworkPolicyId, _seen: &mut BTreeSet<ObjectId>, ) -> Vec<ObjectId>
Returns all the IDs of all objects that depend on network_policy_id
, including network_policy_id
itself.
The order is guaranteed to be in reverse dependency order, i.e. the leafs will appear earlier in the list than the roots. This is particularly useful for the order to drop objects.
sourcefn is_stable(&self, id: CatalogItemId) -> bool
fn is_stable(&self, id: CatalogItemId) -> bool
Indicates whether the indicated item is considered stable or not.
Only stable items can be used as dependencies of other catalog items.
pub(super) fn check_unstable_dependencies( &self, item: &CatalogItem, ) -> Result<(), Error>
pub fn resolve_full_name( &self, name: &QualifiedItemName, conn_id: Option<&ConnectionId>, ) -> FullItemName
pub(super) fn resolve_full_schema_name( &self, name: &QualifiedSchemaName, ) -> FullSchemaName
pub fn get_entry(&self, id: &CatalogItemId) -> &CatalogEntry
pub fn get_entry_by_global_id(&self, id: &GlobalId) -> &CatalogEntry
pub fn get_entries( &self, ) -> impl Iterator<Item = (&CatalogItemId, &CatalogEntry)> + '_
pub fn get_temp_items( &self, conn: &ConnectionId, ) -> impl Iterator<Item = ObjectId> + '_
sourcepub(super) fn get_system_type(&self, name: &str) -> &CatalogEntry
pub(super) fn get_system_type(&self, name: &str) -> &CatalogEntry
Gets a type named name
from exactly one of the system schemas.
§Panics
- If
name
is not an entry in any system schema - If more than one system schema has an entry named
name
.
pub fn get_item_by_name( &self, name: &QualifiedItemName, conn_id: &ConnectionId, ) -> Option<&CatalogEntry>
pub fn get_type_by_name( &self, name: &QualifiedItemName, conn_id: &ConnectionId, ) -> Option<&CatalogEntry>
pub(super) fn find_available_name( &self, name: QualifiedItemName, conn_id: &ConnectionId, ) -> QualifiedItemName
pub fn try_get_entry(&self, id: &CatalogItemId) -> Option<&CatalogEntry>
pub fn try_get_entry_by_global_id(&self, id: &GlobalId) -> Option<&CatalogEntry>
pub(crate) fn get_cluster(&self, cluster_id: ClusterId) -> &Cluster
pub(super) fn try_get_cluster(&self, cluster_id: ClusterId) -> Option<&Cluster>
pub(super) fn try_get_role(&self, id: &RoleId) -> Option<&Role>
pub fn get_role(&self, id: &RoleId) -> &Role
pub fn get_roles(&self) -> impl Iterator<Item = &RoleId>
pub(super) fn try_get_role_by_name(&self, role_name: &str) -> Option<&Role>
pub(super) fn try_get_network_policy_by_name( &self, policy_name: &str, ) -> Option<&NetworkPolicy>
pub(crate) fn collect_role_membership(&self, id: &RoleId) -> BTreeSet<RoleId>
pub fn get_network_policy(&self, id: &NetworkPolicyId) -> &NetworkPolicy
pub fn get_network_policies(&self) -> impl Iterator<Item = &NetworkPolicyId>
sourcepub fn try_get_webhook_url(&self, id: &CatalogItemId) -> Option<Url>
pub fn try_get_webhook_url(&self, id: &CatalogItemId) -> Option<Url>
Returns the URL for POST-ing data to a webhook source, if id
corresponds to a webhook
source.
Note: Identifiers for the source, e.g. item name, are URL encoded.
sourcepub(crate) fn deserialize_plan_with_enable_for_item_parsing(
&mut self,
create_sql: &str,
force_if_exists_skip: bool,
) -> Result<(Plan, ResolvedIds), AdapterError>
pub(crate) fn deserialize_plan_with_enable_for_item_parsing( &mut self, create_sql: &str, force_if_exists_skip: bool, ) -> Result<(Plan, ResolvedIds), AdapterError>
Parses the given SQL string into a pair of Plan
and a ResolvedIds
.
This function will temporarily enable all “enable_for_item_parsing” feature flags. See
CatalogState::with_enable_for_item_parsing
for more details.
NOTE: While this method takes a &mut self
, all mutations are temporary and restored to
their original state before the method returns.
sourcepub(crate) fn parse_plan(
create_sql: &str,
pcx: Option<&PlanContext>,
catalog: &ConnCatalog<'_>,
) -> Result<(Plan, ResolvedIds), AdapterError>
pub(crate) fn parse_plan( create_sql: &str, pcx: Option<&PlanContext>, catalog: &ConnCatalog<'_>, ) -> Result<(Plan, ResolvedIds), AdapterError>
Parses the given SQL string into a pair of Plan
and a ResolvedIds
.
sourcepub(crate) fn deserialize_item(
&self,
global_id: GlobalId,
create_sql: &str,
extra_versions: &BTreeMap<RelationVersion, GlobalId>,
local_expression_cache: &mut LocalExpressionCache,
) -> Result<CatalogItem, AdapterError>
pub(crate) fn deserialize_item( &self, global_id: GlobalId, create_sql: &str, extra_versions: &BTreeMap<RelationVersion, GlobalId>, local_expression_cache: &mut LocalExpressionCache, ) -> Result<CatalogItem, AdapterError>
Parses the given SQL string into a pair of CatalogItem
.
sourcepub(crate) fn parse_item(
&self,
global_id: GlobalId,
create_sql: &str,
extra_versions: &BTreeMap<RelationVersion, GlobalId>,
pcx: Option<&PlanContext>,
is_retained_metrics_object: bool,
custom_logical_compaction_window: Option<CompactionWindow>,
local_expression_cache: &mut LocalExpressionCache,
) -> Result<CatalogItem, AdapterError>
pub(crate) fn parse_item( &self, global_id: GlobalId, create_sql: &str, extra_versions: &BTreeMap<RelationVersion, GlobalId>, pcx: Option<&PlanContext>, is_retained_metrics_object: bool, custom_logical_compaction_window: Option<CompactionWindow>, local_expression_cache: &mut LocalExpressionCache, ) -> Result<CatalogItem, AdapterError>
Parses the given SQL string into a CatalogItem
.
sourcepub(crate) fn parse_item_inner(
&self,
global_id: GlobalId,
create_sql: &str,
extra_versions: &BTreeMap<RelationVersion, GlobalId>,
pcx: Option<&PlanContext>,
is_retained_metrics_object: bool,
custom_logical_compaction_window: Option<CompactionWindow>,
cached_expr: Option<LocalExpressions>,
) -> Result<(CatalogItem, Option<(OptimizedMirRelationExpr, OptimizerFeatures)>), (AdapterError, Option<LocalExpressions>)>
pub(crate) fn parse_item_inner( &self, global_id: GlobalId, create_sql: &str, extra_versions: &BTreeMap<RelationVersion, GlobalId>, pcx: Option<&PlanContext>, is_retained_metrics_object: bool, custom_logical_compaction_window: Option<CompactionWindow>, cached_expr: Option<LocalExpressions>, ) -> Result<(CatalogItem, Option<(OptimizedMirRelationExpr, OptimizerFeatures)>), (AdapterError, Option<LocalExpressions>)>
Parses the given SQL string into a CatalogItem
, using cached_expr
if it’s Some.
On success returns the CatalogItem
and an optimized expression iff the expression was
not cached.
On failure returns an error and cached_expr
so it can be used later.
sourcepub fn with_enable_for_item_parsing<T>(
&mut self,
f: impl FnOnce(&mut Self) -> T,
) -> T
pub fn with_enable_for_item_parsing<T>( &mut self, f: impl FnOnce(&mut Self) -> T, ) -> T
Execute function f
on self
, with all “enable_for_item_parsing” feature flags enabled.
Calling this method will not permanently modify any system configuration variables.
WARNING:
Any modifications made to the system configuration variables in f
, will be lost.
sourcepub fn get_indexes_on(
&self,
id: GlobalId,
cluster: ClusterId,
) -> impl Iterator<Item = (GlobalId, &Index)>
pub fn get_indexes_on( &self, id: GlobalId, cluster: ClusterId, ) -> impl Iterator<Item = (GlobalId, &Index)>
Returns all indexes on the given object and cluster known in the catalog.
pub(super) fn get_database(&self, database_id: &DatabaseId) -> &Database
sourcepub(super) fn try_get_cluster_replica(
&self,
id: ClusterId,
replica_id: ReplicaId,
) -> Option<&ClusterReplica>
pub(super) fn try_get_cluster_replica( &self, id: ClusterId, replica_id: ReplicaId, ) -> Option<&ClusterReplica>
Gets a reference to the specified replica of the specified cluster.
Returns None
if either the cluster or the replica does not
exist.
sourcepub(super) fn get_cluster_replica(
&self,
cluster_id: ClusterId,
replica_id: ReplicaId,
) -> &ClusterReplica
pub(super) fn get_cluster_replica( &self, cluster_id: ClusterId, replica_id: ReplicaId, ) -> &ClusterReplica
Gets a reference to the specified replica of the specified cluster.
Panics if either the cluster or the replica does not exist.
pub(super) fn resolve_replica_in_cluster( &self, cluster_id: &ClusterId, replica_name: &str, ) -> Result<&ClusterReplica, SqlCatalogError>
sourcepub fn get_system_configuration(&self, name: &str) -> Result<&dyn Var, Error>
pub fn get_system_configuration(&self, name: &str) -> Result<&dyn Var, Error>
Get system configuration name
.
sourcepub(super) fn parse_system_configuration(
&self,
name: &str,
value: VarInput<'_>,
) -> Result<String, Error>
pub(super) fn parse_system_configuration( &self, name: &str, value: VarInput<'_>, ) -> Result<String, Error>
Parse system configuration name
with value
int.
Returns the parsed value as a string.
sourcepub(super) fn resolve_schema_in_database(
&self,
database_spec: &ResolvedDatabaseSpecifier,
schema_name: &str,
conn_id: &ConnectionId,
) -> Result<&Schema, SqlCatalogError>
pub(super) fn resolve_schema_in_database( &self, database_spec: &ResolvedDatabaseSpecifier, schema_name: &str, conn_id: &ConnectionId, ) -> Result<&Schema, SqlCatalogError>
Gets the schema map for the database matching database_spec
.
pub fn get_schema( &self, database_spec: &ResolvedDatabaseSpecifier, schema_spec: &SchemaSpecifier, conn_id: &ConnectionId, ) -> &Schema
pub(super) fn find_non_temp_schema(&self, schema_id: &SchemaId) -> &Schema
pub fn get_mz_catalog_schema_id(&self) -> SchemaId
pub fn get_mz_catalog_unstable_schema_id(&self) -> SchemaId
pub fn get_pg_catalog_schema_id(&self) -> SchemaId
pub fn get_information_schema_id(&self) -> SchemaId
pub fn get_mz_internal_schema_id(&self) -> SchemaId
pub fn get_mz_introspection_schema_id(&self) -> SchemaId
pub fn get_mz_unsafe_schema_id(&self) -> SchemaId
pub fn system_schema_ids(&self) -> impl Iterator<Item = SchemaId> + '_
pub fn is_system_schema_id(&self, id: SchemaId) -> bool
pub fn is_system_schema_specifier(&self, spec: SchemaSpecifier) -> bool
pub fn unstable_schema_ids(&self) -> impl Iterator<Item = SchemaId> + '_
pub fn is_unstable_schema_id(&self, id: SchemaId) -> bool
pub fn is_unstable_schema_specifier(&self, spec: SchemaSpecifier) -> bool
sourcepub fn create_temporary_schema(
&mut self,
conn_id: &ConnectionId,
owner_id: RoleId,
) -> Result<(), Error>
pub fn create_temporary_schema( &mut self, conn_id: &ConnectionId, owner_id: RoleId, ) -> Result<(), Error>
Creates a new schema in the Catalog
for temporary items
indicated by the TEMPORARY or TEMP keywords.
sourcepub(crate) fn get_temporary_oids(&self) -> impl Iterator<Item = u32> + '_
pub(crate) fn get_temporary_oids(&self) -> impl Iterator<Item = u32> + '_
Return all OIDs that are allocated to temporary objects.
sourcepub fn resolve_builtin_table(
&self,
builtin: &'static BuiltinTable,
) -> CatalogItemId
pub fn resolve_builtin_table( &self, builtin: &'static BuiltinTable, ) -> CatalogItemId
Optimized lookup for a builtin table.
Panics if the builtin table doesn’t exist in the catalog.
sourcepub fn resolve_builtin_log(
&self,
builtin: &'static BuiltinLog,
) -> (CatalogItemId, GlobalId)
pub fn resolve_builtin_log( &self, builtin: &'static BuiltinLog, ) -> (CatalogItemId, GlobalId)
Optimized lookup for a builtin log.
Panics if the builtin log doesn’t exist in the catalog.
sourcepub fn resolve_builtin_source(
&self,
builtin: &'static BuiltinSource,
) -> CatalogItemId
pub fn resolve_builtin_source( &self, builtin: &'static BuiltinSource, ) -> CatalogItemId
Optimized lookup for a builtin storage collection.
Panics if the builtin storage collection doesn’t exist in the catalog.
sourcepub fn resolve_builtin_object<T: TypeReference>(
&self,
builtin: &Builtin<T>,
) -> CatalogItemId
pub fn resolve_builtin_object<T: TypeReference>( &self, builtin: &Builtin<T>, ) -> CatalogItemId
Optimized lookup for a builtin object.
Panics if the builtin object doesn’t exist in the catalog.
sourcepub fn resolve_builtin_type_references(
&self,
builtin: &BuiltinType<NameReference>,
) -> BuiltinType<IdReference>
pub fn resolve_builtin_type_references( &self, builtin: &BuiltinType<NameReference>, ) -> BuiltinType<IdReference>
Resolve a BuiltinType<NameReference>
to a BuiltinType<IdReference>
.
pub fn config(&self) -> &CatalogConfig
pub fn resolve_database( &self, database_name: &str, ) -> Result<&Database, SqlCatalogError>
pub fn resolve_schema( &self, current_database: Option<&DatabaseId>, database_name: Option<&str>, schema_name: &str, conn_id: &ConnectionId, ) -> Result<&Schema, SqlCatalogError>
sourcepub fn resolve_system_schema(&self, name: &'static str) -> SchemaId
pub fn resolve_system_schema(&self, name: &'static str) -> SchemaId
Optimized lookup for a system schema.
Panics if the system schema doesn’t exist in the catalog.
pub fn resolve_search_path( &self, session: &dyn SessionMetadata, ) -> Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>
pub fn effective_search_path( &self, search_path: &[(ResolvedDatabaseSpecifier, SchemaSpecifier)], include_temp_schema: bool, ) -> Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>
pub fn resolve_cluster(&self, name: &str) -> Result<&Cluster, SqlCatalogError>
pub fn resolve_builtin_cluster(&self, cluster: &BuiltinCluster) -> &Cluster
pub fn resolve_cluster_replica( &self, cluster_replica_name: &QualifiedReplica, ) -> Result<&ClusterReplica, SqlCatalogError>
sourcepub fn resolve(
&self,
get_schema_entries: fn(_: &Schema) -> &BTreeMap<String, CatalogItemId>,
current_database: Option<&DatabaseId>,
search_path: &Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>,
name: &PartialItemName,
conn_id: &ConnectionId,
err_gen: fn(_: String) -> SqlCatalogError,
) -> Result<&CatalogEntry, SqlCatalogError>
pub fn resolve( &self, get_schema_entries: fn(_: &Schema) -> &BTreeMap<String, CatalogItemId>, current_database: Option<&DatabaseId>, search_path: &Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>, name: &PartialItemName, conn_id: &ConnectionId, err_gen: fn(_: String) -> SqlCatalogError, ) -> Result<&CatalogEntry, SqlCatalogError>
Resolves PartialItemName
into a CatalogEntry
.
If name
does not specify a database, the current_database
is used.
If name
does not specify a schema, then the schemas in search_path
are searched in order.
sourcepub fn resolve_entry(
&self,
current_database: Option<&DatabaseId>,
search_path: &Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>,
name: &PartialItemName,
conn_id: &ConnectionId,
) -> Result<&CatalogEntry, SqlCatalogError>
pub fn resolve_entry( &self, current_database: Option<&DatabaseId>, search_path: &Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>, name: &PartialItemName, conn_id: &ConnectionId, ) -> Result<&CatalogEntry, SqlCatalogError>
Resolves name
to a non-function CatalogEntry
.
sourcepub fn resolve_function(
&self,
current_database: Option<&DatabaseId>,
search_path: &Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>,
name: &PartialItemName,
conn_id: &ConnectionId,
) -> Result<&CatalogEntry, SqlCatalogError>
pub fn resolve_function( &self, current_database: Option<&DatabaseId>, search_path: &Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>, name: &PartialItemName, conn_id: &ConnectionId, ) -> Result<&CatalogEntry, SqlCatalogError>
Resolves name
to a function CatalogEntry
.
sourcepub fn resolve_type(
&self,
current_database: Option<&DatabaseId>,
search_path: &Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>,
name: &PartialItemName,
conn_id: &ConnectionId,
) -> Result<&CatalogEntry, SqlCatalogError>
pub fn resolve_type( &self, current_database: Option<&DatabaseId>, search_path: &Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>, name: &PartialItemName, conn_id: &ConnectionId, ) -> Result<&CatalogEntry, SqlCatalogError>
Resolves name
to a type CatalogEntry
.
sourcepub(super) fn get_comment_id(&self, object_id: ObjectId) -> CommentObjectId
pub(super) fn get_comment_id(&self, object_id: ObjectId) -> CommentObjectId
For an ObjectId
gets the corresponding CommentObjectId
.
sourcepub fn system_config(&self) -> &SystemVars
pub fn system_config(&self) -> &SystemVars
Return current system configuration.
sourcepub fn system_config_mut(&mut self) -> &mut SystemVars
pub fn system_config_mut(&mut self) -> &mut SystemVars
Return a mutable reference to the current system configuration.
sourcepub fn dump(
&self,
unfinalized_shards: Option<BTreeSet<String>>,
) -> Result<String, Error>
pub fn dump( &self, unfinalized_shards: Option<BTreeSet<String>>, ) -> Result<String, Error>
Serializes the catalog’s in-memory state.
There are no guarantees about the format of the serialized state, except that the serialized state for two identical catalogs will compare identically.
Some consumers would like the ability to overwrite the unfinalized_shards
catalog field,
which they can accomplish by passing in a value of Some
for the unfinalized_shards
argument.
pub fn availability_zones(&self) -> &[String]
pub fn concretize_replica_location( &self, location: ReplicaLocation, allowed_sizes: &Vec<String>, allowed_availability_zones: Option<&[String]>, ) -> Result<ReplicaLocation, Error>
pub(crate) fn ensure_valid_replica_size( &self, allowed_sizes: &[String], size: &String, ) -> Result<(), Error>
pub fn ensure_not_reserved_role(&self, role_id: &RoleId) -> Result<(), Error>
pub fn ensure_not_reserved_network_policy( &self, network_policy_id: &NetworkPolicyId, ) -> Result<(), Error>
pub fn ensure_grantable_role(&self, role_id: &RoleId) -> Result<(), Error>
pub fn ensure_not_system_role(&self, role_id: &RoleId) -> Result<(), Error>
pub fn ensure_not_predefined_role(&self, role_id: &RoleId) -> Result<(), Error>
pub(crate) fn add_to_audit_log( system_configuration: &SystemVars, oracle_write_ts: Timestamp, session: Option<&ConnMeta>, tx: &mut Transaction<'_>, audit_events: &mut Vec<VersionedEvent>, event_type: EventType, object_type: ObjectType, details: EventDetails, ) -> Result<(), Error>
pub(super) fn get_owner_id( &self, id: &ObjectId, conn_id: &ConnectionId, ) -> Option<RoleId>
pub(super) fn get_object_type(&self, object_id: &ObjectId) -> ObjectType
pub(super) fn get_system_object_type( &self, id: &SystemObjectId, ) -> SystemObjectType
sourcepub fn storage_metadata(&self) -> &StorageMetadata
pub fn storage_metadata(&self) -> &StorageMetadata
Returns a read-only view of the current StorageMetadata
.
To write to this struct, you must use a catalog transaction.
sourcepub fn source_compaction_windows(
&self,
ids: impl IntoIterator<Item = CatalogItemId>,
) -> BTreeMap<CompactionWindow, BTreeSet<CatalogItemId>>
pub fn source_compaction_windows( &self, ids: impl IntoIterator<Item = CatalogItemId>, ) -> BTreeMap<CompactionWindow, BTreeSet<CatalogItemId>>
For the Sources ids in ids
, return the compaction windows for all ids
and additional ids
that propagate from them. Specifically, if ids
contains a source, it and all of its
source exports will be added to the result.
pub fn comment_id_to_item_id(id: &CommentObjectId) -> Option<CatalogItemId>
pub fn get_comment_id_entry( &self, id: &CommentObjectId, ) -> Option<&CatalogEntry>
pub fn comment_id_to_audit_log_name( &self, id: CommentObjectId, conn_id: &ConnectionId, ) -> String
Trait Implementations§
source§impl Clone for CatalogState
impl Clone for CatalogState
source§fn clone(&self) -> CatalogState
fn clone(&self) -> CatalogState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConnectionResolver for CatalogState
impl ConnectionResolver for CatalogState
fn resolve_connection(&self, id: CatalogItemId) -> Connection<InlinedConnection>
source§impl Debug for CatalogState
impl Debug for CatalogState
source§impl OptimizerCatalog for CatalogState
impl OptimizerCatalog for CatalogState
fn get_entry(&self, id: &GlobalId) -> &CatalogEntry
fn get_entry_by_item_id(&self, id: &CatalogItemId) -> &CatalogEntry
fn resolve_full_name( &self, name: &QualifiedItemName, conn_id: Option<&ConnectionId>, ) -> FullItemName
Auto Trait Implementations§
impl Freeze for CatalogState
impl !RefUnwindSafe for CatalogState
impl Send for CatalogState
impl Sync for CatalogState
impl Unpin for CatalogState
impl !UnwindSafe for CatalogState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.