feat(storage): add Bitcask storage migration, binary WAL, and data compaction support

This commit is contained in:
2026-04-04 19:49:47 +00:00
parent 9e7ce25b45
commit d8a8259c73
22 changed files with 2807 additions and 412 deletions
+14 -5
View File
@@ -2,21 +2,30 @@
//!
//! Provides the [`StorageAdapter`] trait and two concrete implementations:
//! - [`MemoryStorageAdapter`] -- fast in-memory store backed by `DashMap`
//! - [`FileStorageAdapter`] -- JSON-file-per-collection persistent store
//! - [`FileStorageAdapter`] -- Bitcask-style append-only log with crash recovery
//!
//! Also includes an [`OpLog`] for operation logging and a [`WriteAheadLog`]
//! for crash recovery.
//! Also includes an [`OpLog`] for operation logging, a [`BinaryWal`] for
//! write-ahead logging, and [`compaction`] for dead record reclamation.
pub mod adapter;
pub mod binary_wal;
pub mod compaction;
pub mod error;
pub mod file;
pub mod keydir;
pub mod memory;
pub mod oplog;
pub mod wal;
pub mod record;
pub use adapter::StorageAdapter;
pub use binary_wal::{BinaryWal, WalEntry, WalOpType};
pub use compaction::{compact_data_file, should_compact, CompactionResult};
pub use error::{StorageError, StorageResult};
pub use file::FileStorageAdapter;
pub use keydir::{KeyDir, KeyDirEntry};
pub use memory::MemoryStorageAdapter;
pub use oplog::{OpLog, OpLogEntry, OpLogStats, OpType};
pub use wal::{WalOp, WalRecord, WriteAheadLog};
pub use record::{
DataRecord, FileHeader, FileType, RecordScanner, FILE_HEADER_SIZE, FILE_MAGIC, FORMAT_VERSION,
RECORD_HEADER_SIZE, RECORD_MAGIC,
};