Struct PartitionCreateOptions

Source
pub struct PartitionCreateOptions { /* private fields */ }
Expand description

Options to configure a partition

Implementations§

Source§

impl CreateOptions

Source

pub fn compression(self, compression: CompressionType) -> Self

Sets the compression method.

Once set for a partition, this property is not considered in the future.

Default = In order: Lz4 -> Miniz -> None, depending on compilation flags

Source

pub fn compaction_strategy( self, compaction_strategy: CompactionStrategy, ) -> Self

Sets the compaction strategy.

Default = Leveled

Source

pub fn manual_journal_persist(self, flag: bool) -> Self

If false, writes will flush data to the operating system.

Default = false

Set to true to handle persistence manually, e.g. manually using PersistMode::SyncData.

Source

pub fn max_memtable_size(self, bytes: u32) -> Self

Sets the maximum memtable size.

Default = 16 MiB

Recommended size 8 - 64 MiB, depending on how much memory is available.

Note that the memory usage may temporarily be max_memtable_size * flush_worker_count because of parallel flushing. Use the keyspace’s max_write_buffer_size to cap global memory usage.

Conversely, if max_memtable_size is larger than 64 MiB, it may require increasing the keyspace’s max_write_buffer_size.

Source

pub fn block_size(self, block_size: u32) -> Self

Sets the block size.

Once set for a partition, this property is not considered in the future.

Default = 4 KiB

For point read heavy workloads (get) a sensible default is somewhere between 4 - 8 KiB, depending on the average value size.

For scan heavy workloads (range, prefix), use 16 - 64 KiB which also increases compression efficiency.

§Panics

Panics if the block size is smaller than 1 KiB or larger than 512 KiB.

Source

pub fn with_kv_separation(self, opts: KvSeparationOptions) -> Self

Enables key-value separation for this partition.

Key-value separation is intended for large value scenarios (1 KiB+ per KV). Large values will be separated into a log-structured value log, which heavily decreases compaction overhead at the cost of slightly higher read latency and higher temporary space usage. Also, garbage collection for deleted or outdated values becomes lazy, so GC needs to be triggered manually. See https://fjall-rs.github.io/post/announcing-fjall-2/#key-value-separation for more information.

Once set for a partition, this property is not considered in the future.

Default = disabled

Trait Implementations§

Source§

impl Clone for CreateOptions

Source§

fn clone(&self) -> CreateOptions

Returns a copy 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 CreateOptions

Source§

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

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

impl Decode for CreateOptions

Source§

fn decode_from<R: Read>(reader: &mut R) -> Result<Self, DecodeError>
where Self: Sized,

Deserializes from reader.
Source§

impl Default for CreateOptions

Source§

fn default() -> Self

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

impl Encode for CreateOptions

Source§

fn encode_into<W: Write>(&self, writer: &mut W) -> Result<(), EncodeError>

Serializes into writer.
Source§

fn encode_into_vec(&self) -> Vec<u8>

Serializes into vector.

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.