체크포인트 영속화 behaviour (SPEC §3.5).
config는 어댑터별 핸들(ETS 테이블 참조, DB 풀 설정 등)이며 실행기는 내용을 모른다.
어댑터 적합성은 ElGraph.CheckpointerContract 공유 테스트로 검증한다.
Summary
Callbacks
체크포인트를 조회한다. :latest는 해당 thread의 최고 step.
보존된 pending writes를 조회한다. 없으면 [].
thread의 체크포인트 메타데이터를 step 오름차순으로 반환한다.
체크포인트를 저장한다. 같은 (thread_id, step)은 덮어쓴다.
superstep 내 완료된 노드들의 쓰기를 보존한다 (부분 실패 재개용 pending writes).
Types
Callbacks
@callback get(config(), thread_id(), :latest | step()) :: {:ok, ElGraph.Checkpoint.t()} | :not_found
체크포인트를 조회한다. :latest는 해당 thread의 최고 step.
@callback get_writes(config(), thread_id(), step()) :: [node_write()]
보존된 pending writes를 조회한다. 없으면 [].
@callback list(config(), thread_id()) :: [%{step: step(), version: pos_integer()}]
thread의 체크포인트 메타데이터를 step 오름차순으로 반환한다.
@callback put(config(), ElGraph.Checkpoint.t()) :: :ok | {:error, term()}
체크포인트를 저장한다. 같은 (thread_id, step)은 덮어쓴다.
@callback put_writes(config(), thread_id(), step(), [node_write()]) :: :ok | {:error, term()}
superstep 내 완료된 노드들의 쓰기를 보존한다 (부분 실패 재개용 pending writes).