Persistent CheckpointStore backed by a SQLite database file.
More...
#include <sqlite_checkpoint.h>
|
| size_t | blob_count () |
| | Number of distinct channel-value blobs currently held.
|
| |
| void | clear_writes (const std::string &thread_id, const std::string &parent_checkpoint_id) override |
| | Discard pending writes for a parent checkpoint once its successor super-step has been fully committed.
|
| |
| void | delete_thread (const std::string &thread_id) override |
| | Delete all checkpoints for a thread.
|
| |
| void | drop_schema () |
| | Drop all neograph_* tables and recreate them.
|
| |
| std::vector< PendingWrite > | get_writes (const std::string &thread_id, const std::string &parent_checkpoint_id) override |
| | Load all pending writes attached to a parent checkpoint.
|
| |
| std::vector< Checkpoint > | list (const std::string &thread_id, int limit=100) override |
| | List checkpoints for a thread, ordered by timestamp (newest first).
|
| |
| std::optional< Checkpoint > | load_by_id (const std::string &id) override |
| | Load a checkpoint by its unique ID.
|
| |
| std::optional< Checkpoint > | load_latest (const std::string &thread_id) override |
| | Load the most recent checkpoint for a thread.
|
| |
| void | put_writes (const std::string &thread_id, const std::string &parent_checkpoint_id, const PendingWrite &write) override |
| | Record a successful node execution within an in-progress super-step.
|
| |
| void | save (const Checkpoint &cp) override |
| | Save a checkpoint.
|
| |
| | SqliteCheckpointStore (const std::string &db_path) |
| |
Persistent CheckpointStore backed by a SQLite database file.
Construct with a filesystem path. ":memory:" works too for tests. The DB file is created if missing; the schema is materialised on first connect via CREATE TABLE IF NOT EXISTS.
Definition at line 66 of file sqlite_checkpoint.h.
◆ SqliteCheckpointStore()
| neograph::graph::SqliteCheckpointStore::SqliteCheckpointStore |
( |
const std::string & |
db_path | ) |
|
|
explicit |
- Parameters
-
| db_path | Filesystem path or ":memory:". Anything sqlite3_open accepts. |
- Exceptions
-
| std::runtime_error | on open or DDL failure. |
◆ blob_count()
| size_t neograph::graph::SqliteCheckpointStore::blob_count |
( |
| ) |
|
◆ clear_writes()
| void neograph::graph::SqliteCheckpointStore::clear_writes |
( |
const std::string & |
, |
|
|
const std::string & |
|
|
) |
| |
|
overridevirtual |
Discard pending writes for a parent checkpoint once its successor super-step has been fully committed.
Called by the engine after the new super-step checkpoint has been durably saved, so pending writes are never cleared while still being the only record of a node's output.
- Parameters
-
| thread_id | Thread identifier. |
| parent_checkpoint_id | Checkpoint whose pending writes to clear. |
Reimplemented from neograph::graph::CheckpointStore.
◆ delete_thread()
| void neograph::graph::SqliteCheckpointStore::delete_thread |
( |
const std::string & |
thread_id | ) |
|
|
overridevirtual |
◆ drop_schema()
| void neograph::graph::SqliteCheckpointStore::drop_schema |
( |
| ) |
|
Drop all neograph_* tables and recreate them.
Test-only utility. Useful in fixtures that want a clean slate per test case.
◆ get_writes()
| std::vector< PendingWrite > neograph::graph::SqliteCheckpointStore::get_writes |
( |
const std::string & |
, |
|
|
const std::string & |
|
|
) |
| |
|
overridevirtual |
Load all pending writes attached to a parent checkpoint.
Called by the engine on resume to skip already-completed tasks. Default implementation returns an empty vector.
- Parameters
-
| thread_id | Thread identifier. |
| parent_checkpoint_id | Checkpoint whose pending writes to load. |
- Returns
- Vector of pending writes, in insertion order.
Reimplemented from neograph::graph::CheckpointStore.
◆ list()
| std::vector< Checkpoint > neograph::graph::SqliteCheckpointStore::list |
( |
const std::string & |
thread_id, |
|
|
int |
limit = 100 |
|
) |
| |
|
overridevirtual |
List checkpoints for a thread, ordered by timestamp (newest first).
- Parameters
-
| thread_id | Thread identifier. |
| limit | Maximum number of checkpoints to return (default: 100). |
- Returns
- Vector of checkpoints.
Reimplemented from neograph::graph::CheckpointStore.
◆ load_by_id()
| std::optional< Checkpoint > neograph::graph::SqliteCheckpointStore::load_by_id |
( |
const std::string & |
id | ) |
|
|
overridevirtual |
◆ load_latest()
| std::optional< Checkpoint > neograph::graph::SqliteCheckpointStore::load_latest |
( |
const std::string & |
thread_id | ) |
|
|
overridevirtual |
Load the most recent checkpoint for a thread.
- Parameters
-
| thread_id | Thread identifier. |
- Returns
- The latest checkpoint, or std::nullopt if none exists.
Reimplemented from neograph::graph::CheckpointStore.
◆ put_writes()
| void neograph::graph::SqliteCheckpointStore::put_writes |
( |
const std::string & |
, |
|
|
const std::string & |
, |
|
|
const PendingWrite & |
|
|
) |
| |
|
overridevirtual |
Record a successful node execution within an in-progress super-step.
Called by the engine immediately after a node returns successfully and before its writes are applied to the shared GraphState. The parent_checkpoint_id anchors the pending write to the super-step boundary it was produced under.
Default implementation is a no-op so custom stores keep working; such stores fall back to "full super-step replay" on resume.
- Parameters
-
| thread_id | Thread identifier. |
| parent_checkpoint_id | Checkpoint marking the start of the in-progress super-step. |
| write | The pending write record to persist. |
Reimplemented from neograph::graph::CheckpointStore.
◆ save()
| void neograph::graph::SqliteCheckpointStore::save |
( |
const Checkpoint & |
cp | ) |
|
|
overridevirtual |
The documentation for this class was generated from the following file: