d_engine_server/storage/mod.rs
1//! Storage layer for d-engine.
2//!
3//! This module provides pluggable and extensible storage components for
4//! persisting Raft state and application data. It defines core traits,
5//! adapters, and utilities to support different backend implementations.
6//!
7//! Key responsibilities include:
8//! - Managing Raft log entries and snapshots.
9//! - Providing an abstraction layer (`StorageEngine`) for persistence.
10//! - Supporting in-memory buffering and disk-backed storage (e.g., via Sled).
11//! - Coordinating state machine application and snapshot lifecycle.
12//! - Managing key expiration through lease-based lifecycle management.
13//!
14//! This module is designed so developers can easily implement custom
15//! storage backends without changing the Raft protocol logic.
16
17/// Storage adaptors providing different backend implementations.
18///
19/// This module contains pluggable storage backends including file-based
20/// and RocksDB-based state machines that implement the `StateMachine` trait.
21pub mod adaptors;
22mod buffered;
23mod lease;
24
25pub use adaptors::*;
26pub use buffered::*;
27// Re-export Lease trait from core for convenience
28pub use d_engine_core::Lease;
29pub use lease::DefaultLease;
30
31#[cfg(test)]
32mod lease_integration_test;
33#[cfg(test)]
34mod lease_unit_test;