pub struct NodeMetadata {
pub defer: bool,
pub metadata: Option<HashMap<String, Value>>,
pub destinations: Option<Vec<String>>,
pub retry_policies: Vec<RetryPolicy>,
pub error_handler: Option<String>,
pub timeout_policies: Vec<TimeoutPolicy>,
pub circuit_breaker: Option<CircuitBreakerConfig>,
pub fallback_node: Option<String>,
}Expand description
Metadata stored for each node during graph construction
Contains configuration options that affect node execution behavior. The actual defer/retry behavior is implemented by the Pregel engine.
Fields§
§defer: boolWhether this node’s execution should be deferred
metadata: Option<HashMap<String, Value>>User-defined metadata for this node
destinations: Option<Vec<String>>Optional list of destination node names
retry_policies: Vec<RetryPolicy>Retry policies for this node
error_handler: Option<String>Optional error handler node name for engine-level error recovery.
When a task executing this node fails, the Pregel engine checks this
field. If set, the engine creates a recovery task targeting the named
handler node instead of canceling all remaining tasks. The error
handler node receives a [NodeError] and returns a [Command] whose
update is applied normally.
timeout_policies: Vec<TimeoutPolicy>Timeout policies for this node, applied by the Pregel engine during superstep execution. The timeout wraps the entire execution (including retry attempts when a retry policy is also configured).
circuit_breaker: Option<CircuitBreakerConfig>Optional circuit breaker configuration for this node.
When configured, the Pregel engine tracks consecutive failures and opens the circuit after the threshold is reached, preventing further execution attempts until the cooldown period expires.
fallback_node: Option<String>Optional fallback node name for graceful degradation.
When a task executing this node fails (after retries), the Pregel engine creates a recovery task targeting the fallback node instead of propagating the error. The fallback node receives the same state as the failed node and its output is applied normally.
Priority order for failure handling:
fallback_node(if set)error_handler(if set)- Cancel remaining tasks
Trait Implementations§
Source§impl Clone for NodeMetadata
impl Clone for NodeMetadata
Source§fn clone(&self) -> NodeMetadata
fn clone(&self) -> NodeMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more