Skip to main content

Crate osproxy_tenancy

Crate osproxy_tenancy 

Source
Expand description

High-level tenancy layer.

Translates declarative tenancy rules (partition key, doc-id construction, injected/sensitive fields, placement lookup) into low-level routing decisions, so most implementers never touch RouteDecision plumbing (docs/02, docs/03).

Two pieces:

  • PlacementTable, the in-memory, epoch-versioned partition→placement map that backs an implementer’s placement_for lookup (M1; fleet store in M7).
  • TenancyRouter, adapts a TenancySpi into a RoutingSpi, resolving the partition, looking up placement, and assembling the body transform.

Structs§

PlacementTable
A concurrent, epoch-versioned map from partition to placement, carrying each partition’s migration state machine (docs/06).
Resolved
A fully resolved routing decision plus the partition it was resolved for.
TenancyRouter
Turns a TenancySpi implementation into a RoutingSpi.

Enums§

MigrationError
Why a migration state transition was refused: the transition does not apply to the partition’s current state. Transitions are total and side-effect-free on failure, so a refused transition leaves the table unchanged.
PartitionState
A partition’s placement state: settled, or migrating between two placements.
Phase
The phase of an in-flight migration (docs/06 §3).
WriteAdmission
Whether a write resolved at a past epoch may still commit (the migration write gate, docs/06 §2).

Traits§

Router
The partition-aware routing seam the engine pipeline drives.

Functions§

resolve_partition_spec
Resolves the partition id by trying spec’s sources in order, the declarative resolver most osproxy_spi::TenancySpi::resolve_partition implementations defer to.