osproxy_tenancy/lib.rs
1//! High-level tenancy layer.
2//!
3//! Translates declarative tenancy rules (partition key, doc-id construction,
4//! injected/sensitive fields, placement lookup) into low-level routing
5//! decisions, so most implementers never touch [`RouteDecision`] plumbing
6//! (`docs/02`, `docs/03`).
7//!
8//! Two pieces:
9//!
10//! - [`PlacementTable`], the in-memory, epoch-versioned partition→placement map
11//! that backs an implementer's `placement_for` lookup (M1; fleet store in M7).
12//! - [`TenancyRouter`], adapts a [`TenancySpi`] into a
13//! [`RoutingSpi`](osproxy_spi::RoutingSpi), resolving the partition, looking up
14//! placement, and assembling the body transform.
15//!
16//! [`RouteDecision`]: osproxy_spi::RouteDecision
17//! [`TenancySpi`]: osproxy_spi::TenancySpi
18#![deny(missing_docs)]
19
20mod migration;
21mod placement_table;
22mod resolve;
23mod router;
24
25pub use migration::{MigrationError, PartitionState, Phase, WriteAdmission};
26pub use placement_table::PlacementTable;
27pub use resolve::resolve_partition_spec;
28pub use router::{Resolved, Router, TenancyRouter};