|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
CheckpointCoordinator — owns the super-step checkpoint lifecycle. More...
#include <neograph/api.h>#include <neograph/graph/types.h>#include <neograph/graph/checkpoint.h>#include <neograph/graph/scheduler.h>#include <memory>#include <optional>#include <string>#include <unordered_map>#include <vector>Go to the source code of this file.
Classes | |
| class | neograph::graph::CheckpointCoordinator |
| Per-run coordinator for checkpoint lifecycle operations. More... | |
| struct | neograph::graph::CheckpointHookContext |
| Per-attempt host identity and control inherited by checkpoint hook delivery. More... | |
| struct | neograph::graph::ResumeContext |
| Context needed to resume execution from the last saved snapshot. More... | |
Functions | |
| NEOGRAPH_API void | neograph::graph::copy_resume_pending_writes (CheckpointStore &store, const Checkpoint &source, const Checkpoint &target) |
Record under target the pending writes that resuming source replays (#390). | |
| NEOGRAPH_API std::vector< PendingWrite > | neograph::graph::resume_pending_writes (CheckpointStore &store, const Checkpoint &checkpoint) |
The pending writes that resuming checkpoint replays (#390). | |
CheckpointCoordinator — owns the super-step checkpoint lifecycle.
Pulled out of GraphEngine::execute_graph so the three intertwined concerns that used to live there — snapshot write, resume-context load, and pending-writes log — each sit behind named methods with their own invariants. The coordinator is a thin, per-run wrapper over a CheckpointStore + thread_id pair:
When the backing store is nullptr or the thread_id is empty, every method is a safe no-op (save returns "", load returns an empty ResumeContext). Callers no longer need to guard on both conditions at every call site.
The coordinator does NOT touch admin APIs (get_state, update_state, fork) — those don't have a super-step boundary and continue to use CheckpointStore directly on GraphEngine.
Definition in file coordinator.h.
| NEOGRAPH_API void neograph::graph::copy_resume_pending_writes | ( | CheckpointStore & | store, |
| const Checkpoint & | source, | ||
| const Checkpoint & | target | ||
| ) |
Record under target the pending writes that resuming source replays (#390).
target is a saved copy of source on another thread, such as a fork: it has the same super-step and does not reach source's ancestry. Resuming it then replays the nodes and Sends that finished in the paused step, exactly as resuming source does, instead of running them again. source keeps its own writes.
References neograph::graph::copy_resume_pending_writes().
Referenced by neograph::graph::copy_resume_pending_writes().
| NEOGRAPH_API std::vector< PendingWrite > neograph::graph::resume_pending_writes | ( | CheckpointStore & | store, |
| const Checkpoint & | checkpoint | ||
| ) |
The pending writes that resuming checkpoint replays (#390).
The writes recorded under the checkpoint and, for a NodeInterrupt checkpoint, the writes of its super-step recorded under its ancestors (the step's parent checkpoint, an earlier interrupt of the same step), stopping at a fork or migration boundary. One per task id, the nearest first: what CheckpointCoordinator::load_for_resume() replays.
References neograph::graph::resume_pending_writes().
Referenced by neograph::graph::resume_pending_writes().