diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2024-10-05 12:58:35 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2024-10-05 12:58:35 +0200 |
| commit | 9f59bf5c621d36fb956ea8a8602b0c37ceaadfe6 (patch) | |
| tree | a7f394048919c94fc758c3e683e449f95c47a700 /src/common.rs | |
| parent | 6532e4f4a94ada35c958cf53e1f98aaf175188c6 (diff) | |
Make write durability configurable
Diffstat (limited to 'src/common.rs')
| -rw-r--r-- | src/common.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common.rs b/src/common.rs index ea179ab..33e99e7 100644 --- a/src/common.rs +++ b/src/common.rs @@ -69,6 +69,20 @@ pub enum MemtableEvictPolicy { LeastReadOrWritten, } +#[derive(Debug, Clone, Eq, PartialEq)] +pub enum WriteDurability { + /// Changes are written to an application-level write buffer without flushing to the OS write buffer or syncing to disk. + /// Offers the lowest durability guarantees but is very fast. + AsyncWrite, + /// Changes are written to the OS write buffer but not synced to disk. + /// Offers better durability guarantees than AsyncWrite but is slower. + /// This is generally recommended. Most OSes will sync the write buffer to disk within a few seconds. + Flush, + /// Changes are written to the OS write buffer and synced to disk. + /// Offers the best durability guarantees but is the slowest. + SyncWrite, +} + #[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)] pub enum IndexableValue { Int(i64), |
