Struct pagecache::ConfigBuilder
[−]
[src]
pub struct ConfigBuilder { /* fields omitted */ }
Top-level configuration for the system.
Examples
let _config = pagecache::ConfigBuilder::default() .path("/path/to/data".to_owned()) .cache_capacity(10_000_000_000) .use_compression(true) .flush_every_ms(Some(1000)) .snapshot_after_ops(100_000);
Read-only mode
let _config = pagecache::ConfigBuilder::default() .path("/path/to/data".to_owned()) .read_only(true);
Methods
impl ConfigBuilder
[src]
pub fn new() -> ConfigBuilder
[src]
Returns a default ConfigBuilder
pub fn path<P: AsRef<Path>>(self, path: P) -> ConfigBuilder
[src]
Set the path of the database (builder).
pub fn set_path<P: AsRef<Path>>(&mut self, path: P)
[src]
Set the path of the database
pub fn merge_operator(self, mo: MergeOperator) -> ConfigBuilder
[src]
Set the merge operator that can be relied on during merges in
the PageCache
.
pub fn build(self) -> Config
[src]
Finalize the configuration.
pub fn set_io_bufs(&mut self, to: usize)
[src]
number of io buffers
pub fn io_bufs(self, to: usize) -> ConfigBuilder
[src]
number of io buffers
pub fn set_io_buf_size(&mut self, to: usize)
[src]
size of each io flush buffer. MUST be multiple of 512!
pub fn io_buf_size(self, to: usize) -> ConfigBuilder
[src]
size of each io flush buffer. MUST be multiple of 512!
pub fn set_min_items_per_segment(&mut self, to: usize)
[src]
minimum data chunks/pages in a segment.
pub fn min_items_per_segment(self, to: usize) -> ConfigBuilder
[src]
minimum data chunks/pages in a segment.
pub fn set_blink_fanout(&mut self, to: usize)
[src]
b-link node fanout, minimum of 2
pub fn blink_fanout(self, to: usize) -> ConfigBuilder
[src]
b-link node fanout, minimum of 2
pub fn set_page_consolidation_threshold(&mut self, to: usize)
[src]
page consolidation threshold
pub fn page_consolidation_threshold(self, to: usize) -> ConfigBuilder
[src]
page consolidation threshold
pub fn set_temporary(&mut self, to: bool)
[src]
if this database should be removed after the ConfigBuilder is dropped
pub fn temporary(self, to: bool) -> ConfigBuilder
[src]
if this database should be removed after the ConfigBuilder is dropped
pub fn set_read_only(&mut self, to: bool)
[src]
whether to run in read-only mode
pub fn read_only(self, to: bool) -> ConfigBuilder
[src]
whether to run in read-only mode
pub fn set_cache_bits(&mut self, to: usize)
[src]
log base 2 of the number of cache shards
pub fn cache_bits(self, to: usize) -> ConfigBuilder
[src]
log base 2 of the number of cache shards
pub fn set_cache_capacity(&mut self, to: usize)
[src]
maximum size for the system page cache
pub fn cache_capacity(self, to: usize) -> ConfigBuilder
[src]
maximum size for the system page cache
pub fn set_use_os_cache(&mut self, to: bool)
[src]
whether to use the OS page cache
pub fn use_os_cache(self, to: bool) -> ConfigBuilder
[src]
whether to use the OS page cache
pub fn set_use_compression(&mut self, to: bool)
[src]
whether to use zstd compression
pub fn use_compression(self, to: bool) -> ConfigBuilder
[src]
whether to use zstd compression
pub fn set_zstd_compression_factor(&mut self, to: i32)
[src]
the compression factor to use with zstd compression
pub fn zstd_compression_factor(self, to: i32) -> ConfigBuilder
[src]
the compression factor to use with zstd compression
pub fn set_flush_every_ms(&mut self, to: Option<u64>)
[src]
number of ms between IO buffer flushes
pub fn flush_every_ms(self, to: Option<u64>) -> ConfigBuilder
[src]
number of ms between IO buffer flushes
pub fn set_snapshot_after_ops(&mut self, to: usize)
[src]
number of operations between page table snapshots
pub fn snapshot_after_ops(self, to: usize) -> ConfigBuilder
[src]
number of operations between page table snapshots
pub fn set_cache_fixup_threshold(&mut self, to: usize)
[src]
the maximum length of a cached page fragment chain
pub fn cache_fixup_threshold(self, to: usize) -> ConfigBuilder
[src]
the maximum length of a cached page fragment chain
pub fn set_segment_cleanup_threshold(&mut self, to: f64)
[src]
the proportion of remaining valid pages in the segment
pub fn segment_cleanup_threshold(self, to: f64) -> ConfigBuilder
[src]
the proportion of remaining valid pages in the segment
pub fn set_min_free_segments(&mut self, to: usize)
[src]
the minimum number of free segments to have on-deck before a compaction occurs
pub fn min_free_segments(self, to: usize) -> ConfigBuilder
[src]
the minimum number of free segments to have on-deck before a compaction occurs
pub fn set_zero_copy_storage(&mut self, to: bool)
[src]
disabling of the log segment copy cleaner
pub fn zero_copy_storage(self, to: bool) -> ConfigBuilder
[src]
disabling of the log segment copy cleaner
pub fn set_segment_mode(&mut self, to: SegmentMode)
[src]
the file segment selection mode
pub fn segment_mode(self, to: SegmentMode) -> ConfigBuilder
[src]
the file segment selection mode
pub fn set_snapshot_path(&mut self, to: Option<OsString>)
[src]
snapshot file location
pub fn snapshot_path(self, to: Option<OsString>) -> ConfigBuilder
[src]
snapshot file location
Trait Implementations
impl Debug for ConfigBuilder
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for ConfigBuilder
[src]
fn eq(&self, __arg_0: &ConfigBuilder) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ConfigBuilder) -> bool
[src]
This method tests for !=
.
impl Clone for ConfigBuilder
[src]
fn clone(&self) -> ConfigBuilder
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Send for ConfigBuilder
[src]
impl Default for ConfigBuilder
[src]
fn default() -> ConfigBuilder
[src]
Returns the "default value" for a type. Read more