mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
add option to disable rocksdb checksums
reference runtime state for default option initialization Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
+29
-21
@@ -1,35 +1,43 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use rocksdb::{ReadOptions, ReadTier, WriteOptions};
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn iter_options_default() -> ReadOptions {
|
||||
let mut options = read_options_default();
|
||||
options.set_background_purge_on_iterator_cleanup(true);
|
||||
//options.set_pin_data(true);
|
||||
options
|
||||
}
|
||||
use crate::Engine;
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn cache_iter_options_default() -> ReadOptions {
|
||||
let mut options = cache_read_options_default();
|
||||
options.set_background_purge_on_iterator_cleanup(true);
|
||||
//options.set_pin_data(true);
|
||||
options
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn cache_read_options_default() -> ReadOptions {
|
||||
let mut options = read_options_default();
|
||||
pub(crate) fn cache_iter_options_default(db: &Arc<Engine>) -> ReadOptions {
|
||||
let mut options = iter_options_default(db);
|
||||
options.set_read_tier(ReadTier::BlockCache);
|
||||
options.fill_cache(false);
|
||||
options
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn read_options_default() -> ReadOptions {
|
||||
let mut options = ReadOptions::default();
|
||||
options.set_total_order_seek(true);
|
||||
pub(crate) fn iter_options_default(db: &Arc<Engine>) -> ReadOptions {
|
||||
let mut options = read_options_default(db);
|
||||
options.set_background_purge_on_iterator_cleanup(true);
|
||||
options
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn write_options_default() -> WriteOptions { WriteOptions::default() }
|
||||
pub(crate) fn cache_read_options_default(db: &Arc<Engine>) -> ReadOptions {
|
||||
let mut options = read_options_default(db);
|
||||
options.set_read_tier(ReadTier::BlockCache);
|
||||
options.fill_cache(false);
|
||||
options
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn read_options_default(db: &Arc<Engine>) -> ReadOptions {
|
||||
let mut options = ReadOptions::default();
|
||||
options.set_total_order_seek(true);
|
||||
|
||||
if !db.checksums {
|
||||
options.set_verify_checksums(false);
|
||||
}
|
||||
|
||||
options
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn write_options_default(_db: &Arc<Engine>) -> WriteOptions { WriteOptions::default() }
|
||||
|
||||
Reference in New Issue
Block a user