35#include <unordered_map>
38namespace neograph::graph {
52 std::string checkpoint_id;
56 std::vector<std::string> next_nodes;
80 std::string thread_id);
83 bool enabled() const noexcept {
return store_ !=
nullptr && !thread_id_.empty(); }
85 const std::shared_ptr<CheckpointStore>& store() const noexcept {
return store_; }
86 const std::string& thread_id() const noexcept {
return thread_id_; }
93 const std::string& current_node,
94 const std::vector<std::string>& next_nodes,
97 const std::string& parent_id,
122 const std::string& task_id,
123 const std::string& task_path,
124 const std::string& node_name,
144 asio::awaitable<std::string> save_super_step_async(
146 const std::string& current_node,
147 const std::vector<std::string>& next_nodes,
150 const std::string& parent_id,
153 asio::awaitable<void> record_pending_write_async(
154 const std::string& parent_cp_id,
155 const std::string& task_id,
156 const std::string& task_path,
157 const std::string& node_name,
161 asio::awaitable<void> clear_pending_writes_async(
162 const std::string& parent_cp_id)
const;
165 std::shared_ptr<CheckpointStore> store_;
166 std::string thread_id_;
NEOGRAPH_API export/import macro for shared-library builds.
Checkpoint system for graph execution state persistence and time-travel.
CheckpointPhase
Phase at which a Checkpoint was produced.
Per-run coordinator for checkpoint lifecycle operations.
CheckpointCoordinator(std::shared_ptr< CheckpointStore > store, std::string thread_id)
ResumeContext load_for_resume() const
Load the latest checkpoint + all pending writes attached to it.
void record_pending_write(const std::string &parent_cp_id, const std::string &task_id, const std::string &task_path, const std::string &node_name, const NodeResult &nr, int step) const
Durably record a completed node's writes under parent_cp_id.
void clear_pending_writes(const std::string &parent_cp_id) const
Drop the pending-writes log for a parent cp after its super-step has been successfully committed.
bool enabled() const noexcept
asio::awaitable< ResumeContext > load_for_resume_async() const
Async peer of load_for_resume (Sem 3.7.5).
std::string save_super_step(const GraphState &state, const std::string ¤t_node, const std::vector< std::string > &next_nodes, CheckpointPhase phase, int step, const std::string &parent_id, const BarrierState &barrier_state) const
Write a super-step snapshot.
Thread-safe container for all graph state channels.
Graph engine type definitions: channels, edges, nodes, events, and control flow.
Pure routing / next-step-planning logic extracted from GraphEngine.
std::map< std::string, std::set< std::string > > BarrierState
Per-barrier signal bookkeeping.
Extended result returned by node execution.
Context needed to resume execution from the last saved snapshot.
BarrierState barrier_state
Barrier accumulators for in-flight AND-joins.
json channel_values
Serialized GraphState at cp time.
std::unordered_map< std::string, NodeResult > replay_results
Partially-completed super-step writes, keyed by task_id.
int start_step
Phase-adjusted step to re-enter at.