RotorTreeConfig controls all aspects of how a RotorTree persists data, including WAL flushing, checkpointing, and memory/disk tiering.
Definition
Defined insrc/storage/mod.rs:56
Fields
Directory path where the WAL and data files are stored. The directory will be created if it doesn’t exist.The structure will contain:
walfile for write-ahead logdata/directory for checkpoint files after the first checkpoint
Controls when WAL entries are fsynced to disk.Options:
FlushPolicy::Interval(Duration)- Periodic fsync (default: 10ms)FlushPolicy::Manual- Application controls viaflush()
Controls when checkpoints are triggered to materialize tree state to data files.Options:
Manual(default)EveryNEntries(u64)MemoryThreshold(usize)OnClose
Controls which tree levels are kept in memory vs mmap’d from disk after checkpoint.See TieringConfig for details.
When
true, recomputes the Merkle root on recovery to detect corruption beyond CRC checks.Default: Typically set to true for maximum safety.Tradeoff: Setting to false speeds up recovery but only relies on CRC validation.Usage Example
Common Configurations
High Throughput
Maximum Safety
Blockchain Sync
flush() after each block, checkpoint() after each epoch.Development
Related
- FlushPolicy - WAL fsync control
- CheckpointPolicy - Checkpoint triggers
- TieringConfig - Memory/disk tiering
- RotorTree::open() - Opening a persistent tree
