store: redb indexes offsets into capnp log, not full nodes
Restructure store module with clearer file names: - persist.rs → capnp.rs (capnp log IO) - db.rs → index.rs (redb index operations) redb now stores key → offset mapping, not serialized nodes. Mutations record the offset after appending to capnp log. rebuild_index scans capnp log to reconstruct the index. The HashMap still exists for now; next step is to use the index for lookups and remove it. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
9309de68fc
commit
f413a853d8
5 changed files with 225 additions and 149 deletions
|
|
@ -7,17 +7,17 @@
|
|||
// redb provides indexed access; Store struct holds in-memory state.
|
||||
//
|
||||
// Module layout:
|
||||
// types.rs — Node, Relation, enums, capnp macros, path helpers
|
||||
// view.rs — StoreView trait for read-only access
|
||||
// persist.rs — load, replay, append (capnp IO)
|
||||
// ops.rs — mutations (upsert, delete, decay, cap_degree, etc.)
|
||||
// mod.rs — re-exports, key resolution, ingestion, rendering
|
||||
// types.rs — Node, Relation, enums, capnp macros, path helpers
|
||||
// index.rs — redb index operations
|
||||
// capnp.rs — capnp log IO (load, replay, append, fsck)
|
||||
// ops.rs — mutations (upsert, delete, rename, etc.)
|
||||
// view.rs — StoreView trait for read-only access
|
||||
|
||||
mod types;
|
||||
mod view;
|
||||
mod persist;
|
||||
mod index;
|
||||
mod capnp;
|
||||
mod ops;
|
||||
pub mod db;
|
||||
mod view;
|
||||
|
||||
// Re-export everything callers need
|
||||
pub use types::{
|
||||
|
|
@ -27,7 +27,7 @@ pub use types::{
|
|||
new_node, new_relation,
|
||||
};
|
||||
pub use view::StoreView;
|
||||
pub use persist::fsck;
|
||||
pub use capnp::fsck;
|
||||
pub use ops::current_provenance;
|
||||
|
||||
use crate::graph::{self, Graph};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue