pub enum Placement {
DedicatedCluster {
cluster: ClusterId,
},
DedicatedIndex {
cluster: ClusterId,
index: IndexName,
},
SharedIndex {
cluster: ClusterId,
index: IndexName,
inject: Vec<InjectedField>,
},
}Expand description
The resolved home of a partition.
The three modes trade isolation against density (docs/03 §3):
DedicatedCluster: the partition owns a whole cluster (its index name is carried unchanged from the request’s logical index).DedicatedIndex: the partition owns a physical index on a shared cluster.SharedIndex: many partitions share one physical index; isolation is enforced by injected partition fields (whose names the SPI chose) plus a partition filter on read.
Deliberately not #[non_exhaustive]: the proxy core must interpret every
placement mode to route correctly, so adding a mode should force every match
in the workspace to be updated rather than silently fall through (docs/03).
§Examples
use osproxy_spi::Placement;
use osproxy_spi::core::{ClusterId, IndexName};
let p = Placement::SharedIndex {
cluster: ClusterId::from("eu-1"),
index: IndexName::from("shared"),
inject: vec![],
};
assert_eq!(p.cluster().as_str(), "eu-1");Variants§
DedicatedCluster
The partition has a dedicated cluster.
DedicatedIndex
The partition has a dedicated index on a shared cluster.
Fields
The partition shares a physical index with others, isolated by the injected fields named here.
Implementations§
Trait Implementations§
impl Eq for Placement
impl StructuralPartialEq for Placement
Auto Trait Implementations§
impl Freeze for Placement
impl RefUnwindSafe for Placement
impl Send for Placement
impl Sync for Placement
impl Unpin for Placement
impl UnsafeUnpin for Placement
impl UnwindSafe for Placement
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
Mutably borrows from an owned value. Read more