MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / database_for_tenant

Method database_for_tenant

nodedb/src/data/executor/core_loop/maintenance.rs:71–79  ·  view source on GitHub ↗

Resolve the `DatabaseId` for a `TenantId`. Falls back to `DatabaseId::DEFAULT` when the mapping has not been seen yet.

(
        &self,
        tenant: crate::types::TenantId,
    )

Source from the content-addressed store, hash-verified

69 /// Resolve the `DatabaseId` for a `TenantId`. Falls back to
70 /// `DatabaseId::DEFAULT` when the mapping has not been seen yet.
71 pub(in crate::data::executor) fn database_for_tenant(
72 &self,
73 tenant: crate::types::TenantId,
74 ) -> nodedb_types::DatabaseId {
75 self.tenant_database_map
76 .get(&tenant)
77 .copied()
78 .unwrap_or(nodedb_types::DatabaseId::DEFAULT)
79 }
80
81 /// Set checkpoint coordinator config (called after open, before event loop).
82 pub fn set_checkpoint_config(&mut self, config: crate::storage::checkpoint::CheckpointConfig) {

Callers 2

run_compactionMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected