A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
graph_snapshot.h
Go to the documentation of this file.
1// Copyright 2026 The A11 Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef A11_WASM_GRAPH_SNAPSHOT_H_
16#define A11_WASM_GRAPH_SNAPSHOT_H_
17
18#include <memory>
19#include <string>
20#include <string_view>
21
22#include <absl/container/flat_hash_map.h>
23#include <absl/status/statusor.h>
24
26
27namespace a11::nodes {
28class NodeMap;
29} // namespace a11::nodes
30
31namespace a11::stores {
32class LocalChunkStore;
33} // namespace a11::stores
34
35namespace a11::wasm {
36
39 absl::flat_hash_map<std::string, std::shared_ptr<stores::LocalChunkStore>>
41};
42
44 std::shared_ptr<nodes::NodeMap> nodes;
45 std::shared_ptr<StoreRegistry> registry;
46};
47
48absl::StatusOr<std::shared_ptr<nodes::NodeMap>> MakeTrackedNodeMap(
49 const std::shared_ptr<StoreRegistry>& registry,
50 std::string storage_id);
51absl::StatusOr<std::string> ExportGraphSnapshot(StoreRegistry& registry,
52 const std::string& storage_id);
53absl::StatusOr<RestoredStores> RestoreGraphSnapshot(
54 std::string_view bytes, const std::string& storage_id);
55
56} // namespace a11::wasm
57
58#endif // A11_WASM_GRAPH_SNAPSHOT_H_
Definition boost_primitives.h:21
Definition action.h:70
Definition node_map.h:47
Definition async_task.cc:27
absl::StatusOr< RestoredStores > RestoreGraphSnapshot(std::string_view bytes, const std::string &storage_id)
Definition graph_snapshot.cc:127
absl::StatusOr< std::shared_ptr< nodes::NodeMap > > MakeTrackedNodeMap(const std::shared_ptr< StoreRegistry > &registry, std::string storage_id)
Definition graph_snapshot.cc:45
absl::StatusOr< std::string > ExportGraphSnapshot(StoreRegistry &registry, const std::string &storage_id)
Definition graph_snapshot.cc:67
Definition graph_snapshot.h:43
std::shared_ptr< StoreRegistry > registry
Definition graph_snapshot.h:45
std::shared_ptr< nodes::NodeMap > nodes
Definition graph_snapshot.h:44
Definition graph_snapshot.h:37
thread::Mutex mu
Definition graph_snapshot.h:38
absl::flat_hash_map< std::string, std::shared_ptr< stores::LocalChunkStore > > stores ABSL_GUARDED_BY(mu)