PartitionConfig

Struct PartitionConfig 

Source
pub struct PartitionConfig {
    pub shard_count: u16,
    pub segment_max_bytes: usize,
    pub use_meta: bool,
}
Expand description

Configuration for partitioned tables.

This structure defines how data is distributed across shards and segments, providing control over write amplification and read performance.

Fields§

§shard_count: u16

Number of shards to distribute writes across

Higher values spread writes better for hot keys but increase read fanout. Must be between 1 and 65535.

§segment_max_bytes: usize

Maximum size in bytes for a single segment before rolling

When a segment exceeds this size, a new segment is created. This controls write amplification - smaller segments rewrite less data but increase read overhead.

§use_meta: bool

Whether to use a meta table for O(1) head segment discovery

With meta: Faster writes, additional storage overhead Without meta: Simpler, but requires scanning to find writable segment

Implementations§

Source§

impl PartitionConfig

Source

pub fn new( shard_count: u16, segment_max_bytes: usize, use_meta: bool, ) -> Result<Self>

Creates a new partition configuration with sensible defaults.

§Arguments
  • shard_count - Number of shards (1-65535)
  • segment_max_bytes - Maximum segment size in bytes
  • use_meta - Whether to use meta table
§Returns

Validated configuration or error

Source

pub fn default() -> Self

Creates a default configuration suitable for most use cases.

Trait Implementations§

Source§

impl Clone for PartitionConfig

Source§

fn clone(&self) -> PartitionConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PartitionConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PartitionConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.