pub struct NodeConfig {
pub node_id: NodeId,
pub storage_uri: String,
pub cache_dir: PathBuf,
pub cores: usize,
pub memory_bytes: u64,
pub memory_per_bee: u64,
pub target_cell_size: u64,
pub max_cell_size: u64,
pub min_cell_size: u64,
pub max_cache_size: u64,
pub heartbeat_interval: Duration,
pub dead_threshold: Duration,
}Expand description
Configuration for an Apiary node, including auto-detected system capacity.
Fields§
§node_id: NodeIdUnique identifier for this node.
storage_uri: StringStorage URI: "local://~/.apiary/data" or "s3://bucket/prefix".
cache_dir: PathBufLocal directory for cell cache and scratch files.
cores: usizeNumber of CPU cores (auto-detected).
memory_bytes: u64Total memory in bytes (auto-detected).
memory_per_bee: u64Memory budget per bee in bytes (memory_bytes / cores).
target_cell_size: u64Target cell size in bytes for leafcutter sizing (memory_per_bee / 4).
max_cell_size: u64Maximum cell size in bytes (target_cell_size * 2).
min_cell_size: u64Minimum cell size in bytes (floor to amortise S3 overhead).
max_cache_size: u64Maximum cache size in bytes for local cell storage.
heartbeat_interval: DurationInterval between heartbeat writes.
dead_threshold: DurationDuration after which a node with no heartbeat is considered dead.
Implementations§
Source§impl NodeConfig
impl NodeConfig
Sourcepub fn detect(storage_uri: impl Into<String>) -> Self
pub fn detect(storage_uri: impl Into<String>) -> Self
Create a new NodeConfig by auto-detecting system resources.
§Arguments
storage_uri— The storage backend URI (e.g.,"local://~/.apiary/data"or"s3://bucket/prefix").
§Example
use apiary_core::config::NodeConfig;
let config = NodeConfig::detect("local://~/.apiary/data");
assert!(config.cores > 0);
assert!(config.memory_bytes > 0);Trait Implementations§
Source§impl Clone for NodeConfig
impl Clone for NodeConfig
Source§fn clone(&self) -> NodeConfig
fn clone(&self) -> NodeConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeConfig
impl Debug for NodeConfig
Source§impl<'de> Deserialize<'de> for NodeConfig
impl<'de> Deserialize<'de> for NodeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NodeConfig
impl RefUnwindSafe for NodeConfig
impl Send for NodeConfig
impl Sync for NodeConfig
impl Unpin for NodeConfig
impl UnsafeUnpin for NodeConfig
impl UnwindSafe for NodeConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more