pub struct KeyspaceCreateOptions {
pub data_block_hash_ratio_policy: HashRatioPolicy,
/* private fields */
}Expand description
Options to configure a keyspace
Fields§
§data_block_hash_ratio_policy: HashRatioPolicyData block hash ratio
Implementations§
Source§impl CreateOptions
impl CreateOptions
Sourcepub fn with_kv_separation(
self,
opts: Option<KvSeparationOptions>,
) -> CreateOptions
pub fn with_kv_separation( self, opts: Option<KvSeparationOptions>, ) -> CreateOptions
Toggles key-value separation.
Sourcepub fn data_block_restart_interval_policy(
self,
policy: RestartIntervalPolicy,
) -> CreateOptions
pub fn data_block_restart_interval_policy( self, policy: RestartIntervalPolicy, ) -> CreateOptions
Sets the restart interval inside data blocks.
A higher restart interval saves space while increasing lookup times inside data blocks.
Default = 16
Sourcepub fn filter_block_pinning_policy(self, policy: PinningPolicy) -> CreateOptions
pub fn filter_block_pinning_policy(self, policy: PinningPolicy) -> CreateOptions
Sets the pinning policy for filter blocks.
By default, L0 filter blocks are pinned.
Sourcepub fn index_block_pinning_policy(self, policy: PinningPolicy) -> CreateOptions
pub fn index_block_pinning_policy(self, policy: PinningPolicy) -> CreateOptions
Sets the pinning policy for index blocks.
By default, L0 and L1 index blocks are pinned.
Sourcepub fn filter_block_partitioning_policy(
self,
policy: PinningPolicy,
) -> CreateOptions
pub fn filter_block_partitioning_policy( self, policy: PinningPolicy, ) -> CreateOptions
Sets the partitioning policy for filter blocks.
Sourcepub fn index_block_partitioning_policy(
self,
policy: PinningPolicy,
) -> CreateOptions
pub fn index_block_partitioning_policy( self, policy: PinningPolicy, ) -> CreateOptions
Sets the partitioning policy for index blocks.
Sourcepub fn filter_policy(self, policy: FilterPolicy) -> CreateOptions
pub fn filter_policy(self, policy: FilterPolicy) -> CreateOptions
Sets the filter policy for data blocks.
Sourcepub fn expect_point_read_hits(self, b: bool) -> CreateOptions
pub fn expect_point_read_hits(self, b: bool) -> CreateOptions
If true, the last level will not build filters, reducing the filter size of a database
by ~90% typically.
Enable this only if you know that point reads generally are expected to find a key-value pair.
Sourcepub fn data_block_compression_policy(
self,
policy: CompressionPolicy,
) -> CreateOptions
pub fn data_block_compression_policy( self, policy: CompressionPolicy, ) -> CreateOptions
Sets the compression policy for data blocks.
Sourcepub fn index_block_compression_policy(
self,
policy: CompressionPolicy,
) -> CreateOptions
pub fn index_block_compression_policy( self, policy: CompressionPolicy, ) -> CreateOptions
Sets the compression policy for index blocks.
Sourcepub fn compaction_strategy(
self,
compaction_strategy: Arc<dyn CompactionStrategy + Sync + Send>,
) -> CreateOptions
pub fn compaction_strategy( self, compaction_strategy: Arc<dyn CompactionStrategy + Sync + Send>, ) -> CreateOptions
Sets the compaction strategy.
Default = Leveled
Sourcepub fn manual_journal_persist(self, flag: bool) -> CreateOptions
pub fn manual_journal_persist(self, flag: bool) -> CreateOptions
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.
Sourcepub fn max_memtable_size(self, bytes: u64) -> CreateOptions
pub fn max_memtable_size(self, bytes: u64) -> CreateOptions
Sets the maximum memtable size.
Default = 64 MiB
Recommended size 8 - 64 MiB, depending on how much memory is available.
Conversely, if max_memtable_size is larger than 64 MiB,
it may require increasing the database’s max_write_buffer_size.
Sourcepub fn data_block_size_policy(self, policy: BlockSizePolicy) -> CreateOptions
pub fn data_block_size_policy(self, policy: BlockSizePolicy) -> CreateOptions
Sets the block size.
Once set for a keyspace, 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 more space efficiency, block size between 16 - 64 KiB are sensible.
§Panics
Panics if the block size is smaller than 1 KiB or larger than 1 MiB.
Trait Implementations§
Source§impl Clone for CreateOptions
impl Clone for CreateOptions
Source§fn clone(&self) -> CreateOptions
fn clone(&self) -> CreateOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for CreateOptions
impl Default for CreateOptions
Source§fn default() -> CreateOptions
fn default() -> CreateOptions
Auto Trait Implementations§
impl Freeze for CreateOptions
impl !RefUnwindSafe for CreateOptions
impl Send for CreateOptions
impl Sync for CreateOptions
impl Unpin for CreateOptions
impl UnsafeUnpin for CreateOptions
impl !UnwindSafe for CreateOptions
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.