state_manager¶
state_manager ¶
State management for checkpointing and recovery.
StateManager ¶
Manages execution state persistence and recovery.
Follows Single Responsibility: only handles state management. Uses Strategy pattern for pluggable storage backends.
Initialize state manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage
|
CheckpointStorage
|
Checkpoint storage backend |
required |
checkpoint_interval
|
int
|
Rows between checkpoints |
500
|
Source code in ondine/orchestration/state_manager.py
should_checkpoint ¶
Check if checkpoint should be saved.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_row
|
int
|
Current row index |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if checkpoint due |
Source code in ondine/orchestration/state_manager.py
save_checkpoint ¶
Save checkpoint for execution context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
ExecutionContext
|
Execution context to save |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if successful |
Source code in ondine/orchestration/state_manager.py
load_checkpoint ¶
Load checkpoint for session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_id
|
UUID
|
Session identifier |
required |
Returns:
| Type | Description |
|---|---|
ExecutionContext | None
|
Restored execution context or None |
Source code in ondine/orchestration/state_manager.py
can_resume ¶
Check if session can be resumed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_id
|
UUID
|
Session identifier |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if checkpoint exists |
cleanup_checkpoints ¶
Delete checkpoints for session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_id
|
UUID
|
Session identifier |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if deleted |
Source code in ondine/orchestration/state_manager.py
list_checkpoints ¶
List all available checkpoints.
Returns:
| Type | Description |
|---|---|
list[CheckpointInfo]
|
List of checkpoint information |