-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.rs
More file actions
60 lines (58 loc) · 2.29 KB
/
Copy pathlib.rs
File metadata and controls
60 lines (58 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! `minikv_core`
//!
//! Core library for a deterministic, replicated object metadata layer.
//!
//! This crate provides the hashing, volume selection, record encoding,
//! replication, rebuild, and rebalance logic required to maintain
//! a consistent mapping between object keys and storage volumes.
//!
//! The system is designed around the following principles:
//!
//! - Deterministic key → path mapping (`key_to_path`)
//! - Deterministic key → replica selection (`key_to_volume`)
//! - Explicit, auditable record encoding (`Record`)
//! - Metadata recovery from storage volumes (`rebuild_all`)
//! - Convergence to ideal replica placement (`rebalance_all`)
//!
//! The crate does not implement an HTTP server. It focuses strictly on:
//!
//! - Metadata representation and storage abstraction (`MetadataStore`)
//! - Volume interaction primitives (`remote_get`, `remote_put`, etc.)
//! - Replica placement and reconciliation logic
//!
//! All replica selection and ordering is deterministic. Any change to
//! hashing or volume selection logic will change placement and is therefore
//! considered a breaking behavioural change.
//!
//! # High-Level Architecture
//!
//! - `hashing` : Key-to-path and volume scoring primitives.
//! - `volumes` : Replica selection and rebalance detection.
//! - `record` : On-disk metadata encoding format.
//! - `storage` : Metadata storage abstraction.
//! - `replication` : HTTP primitives for volume interaction.
//! - `rebuild` : Metadata reconstruction from volumes.
//! - `rebalance` : Migration to ideal replica sets.
//! - `locking` : Per-key concurrency control.
//!
//! This crate is intended to be embedded in a higher-level service.
pub mod error;
pub mod hashing;
pub mod locking;
pub mod rebalance;
pub mod rebuild;
pub mod record;
pub mod replication;
pub mod state;
pub mod storage;
pub mod volumes;
pub use error::Error;
pub use hashing::{key_to_path, volume_score};
pub use locking::{KeyGuard, KeyLock};
pub use rebalance::{rebalance_all, rebalance_key};
pub use rebuild::{AutoindexEntry, rebuild_all};
pub use record::{Deleted, Record};
pub use replication::{build_volume_client, remote_delete, remote_get, remote_head, remote_put};
pub use state::AppState;
pub use storage::{KeyValuePair, MetadataStore};
pub use volumes::{key_to_volume, needs_rebalance};