pub enum PartitionSpec {
Hash {
columns: Vec<String>,
buckets: u32,
},
Range {
columns: Vec<String>,
},
Tenant {
column: String,
buckets_per_tenant: u32,
},
TimeRange {
column: String,
},
Unpartitioned,
}Expand description
How one table’s rows map onto tablets — the planner’s dependency-free
mirror of mongreldb_cluster::tablet::Partitioning (spec section 12.2).
The cluster wave adapts the cluster type onto this enum one-to-one.
Variants§
Hash
Hash of the declared columns into a fixed bucket space.
Range
Lexicographic ranges over the declared columns.
Tenant
One bucket space per tenant.
TimeRange
Time-bucketed ranges over the timestamp column.
Unpartitioned
Single-tablet (unpartitioned) table.
Implementations§
Source§impl PartitionSpec
impl PartitionSpec
Sourcepub fn partition_columns(&self) -> Vec<&str>
pub fn partition_columns(&self) -> Vec<&str>
The declared partition-key columns, in key order.
Sourcepub fn colocated_with(&self, other: &PartitionSpec) -> bool
pub fn colocated_with(&self, other: &PartitionSpec) -> bool
True when two tables partition identically, so equal partition keys land on the same tablet and a join on the partition key can be planned colocated (spec section 12.10: “colocated join”). Two unpartitioned tables are trivially colocated (both live on their single tablet).
Trait Implementations§
Source§impl Clone for PartitionSpec
impl Clone for PartitionSpec
Source§fn clone(&self) -> PartitionSpec
fn clone(&self) -> PartitionSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PartitionSpec
impl Debug for PartitionSpec
Source§impl<'de> Deserialize<'de> for PartitionSpec
impl<'de> Deserialize<'de> for PartitionSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PartitionSpec
Source§impl PartialEq for PartitionSpec
impl PartialEq for PartitionSpec
Source§impl Serialize for PartitionSpec
impl Serialize for PartitionSpec
impl StructuralPartialEq for PartitionSpec
Auto Trait Implementations§
impl Freeze for PartitionSpec
impl RefUnwindSafe for PartitionSpec
impl Send for PartitionSpec
impl Sync for PartitionSpec
impl Unpin for PartitionSpec
impl UnsafeUnpin for PartitionSpec
impl UnwindSafe for PartitionSpec
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more