summaryrefslogtreecommitdiff
path: root/src/other_tools/ops_maps
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-13 10:16:29 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-06-18 12:05:10 +0200
commitdc9a7b8499da9ce7a90546afecd048d0bfb31f38 (patch)
treeefc036d485bb8418ffbf77957be2d5f2252a9306 /src/other_tools/ops_maps
parentd08e6f1af5a96818c9e7c2c9e0a6288470489822 (diff)
downloadjustbuild-dc9a7b8499da9ce7a90546afecd048d0bfb31f38.tar.gz
Make ServeApi a general class, not a singleton
...and adjust interfaces.
Diffstat (limited to 'src/other_tools/ops_maps')
-rw-r--r--src/other_tools/ops_maps/content_cas_map.cpp8
-rw-r--r--src/other_tools/ops_maps/content_cas_map.hpp2
-rw-r--r--src/other_tools/ops_maps/git_tree_fetch_map.cpp8
-rw-r--r--src/other_tools/ops_maps/git_tree_fetch_map.hpp2
4 files changed, 10 insertions, 10 deletions
diff --git a/src/other_tools/ops_maps/content_cas_map.cpp b/src/other_tools/ops_maps/content_cas_map.cpp
index 527bd7de..97e959d4 100644
--- a/src/other_tools/ops_maps/content_cas_map.cpp
+++ b/src/other_tools/ops_maps/content_cas_map.cpp
@@ -108,7 +108,7 @@ auto CreateContentCASMap(
MirrorsPtr const& additional_mirrors,
CAInfoPtr const& ca_info,
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
- std::optional<gsl::not_null<const ServeApi*>> const& serve,
+ std::optional<ServeApi> const& serve,
gsl::not_null<IExecutionApi*> const& local_api,
std::optional<gsl::not_null<IExecutionApi*>> const& remote_api,
std::size_t jobs) -> ContentCASMap {
@@ -116,7 +116,7 @@ auto CreateContentCASMap(
additional_mirrors,
ca_info,
critical_git_op_map,
- serve,
+ &serve,
local_api,
remote_api](auto ts,
auto setter,
@@ -149,7 +149,7 @@ auto CreateContentCASMap(
just_mr_paths,
additional_mirrors,
ca_info,
- serve,
+ &serve,
local_api,
remote_api,
setter,
@@ -216,7 +216,7 @@ auto CreateContentCASMap(
}
// check if content is known to remote serve service
if (serve and remote_api and
- (*serve)->ContentInRemoteCAS(key.content)) {
+ serve->ContentInRemoteCAS(key.content)) {
// try to get content from remote CAS
if (remote_api.value()->RetrieveToCas(
{Artifact::ObjectInfo{.digest = digest,
diff --git a/src/other_tools/ops_maps/content_cas_map.hpp b/src/other_tools/ops_maps/content_cas_map.hpp
index 9e8d9f46..0fb66970 100644
--- a/src/other_tools/ops_maps/content_cas_map.hpp
+++ b/src/other_tools/ops_maps/content_cas_map.hpp
@@ -84,7 +84,7 @@ using ContentCASMap = AsyncMapConsumer<ArchiveContent, std::nullptr_t>;
MirrorsPtr const& additional_mirrors,
CAInfoPtr const& ca_info,
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
- std::optional<gsl::not_null<const ServeApi*>> const& serve,
+ std::optional<ServeApi> const& serve,
gsl::not_null<IExecutionApi*> const& local_api,
std::optional<gsl::not_null<IExecutionApi*>> const& remote_api,
std::size_t jobs) -> ContentCASMap;
diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.cpp b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
index 10095045..b99c7814 100644
--- a/src/other_tools/ops_maps/git_tree_fetch_map.cpp
+++ b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
@@ -128,7 +128,7 @@ auto CreateGitTreeFetchMap(
gsl::not_null<ImportToGitMap*> const& import_to_git_map,
std::string const& git_bin,
std::vector<std::string> const& launcher,
- std::optional<gsl::not_null<const ServeApi*>> const& serve,
+ std::optional<ServeApi> const& serve,
gsl::not_null<IExecutionApi*> const& local_api,
std::optional<gsl::not_null<IExecutionApi*>> const& remote_api,
bool backup_to_remote,
@@ -137,7 +137,7 @@ auto CreateGitTreeFetchMap(
import_to_git_map,
git_bin,
launcher,
- serve,
+ &serve,
local_api,
remote_api,
backup_to_remote](auto ts,
@@ -163,7 +163,7 @@ auto CreateGitTreeFetchMap(
import_to_git_map,
git_bin,
launcher,
- serve,
+ &serve,
local_api,
remote_api,
backup_to_remote,
@@ -235,7 +235,7 @@ auto CreateGitTreeFetchMap(
// as we anyway interrogate the remote execution endpoint,
// we're only interested here in the serve endpoint making
// an attempt to upload the tree, if known, to remote CAS
- std::ignore = (*serve)->TreeInRemoteCAS(key.hash);
+ std::ignore = serve->TreeInRemoteCAS(key.hash);
}
// check if tree is in remote CAS, if a remote is given
if (remote_api and
diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.hpp b/src/other_tools/ops_maps/git_tree_fetch_map.hpp
index 3f6e6769..93ca450f 100644
--- a/src/other_tools/ops_maps/git_tree_fetch_map.hpp
+++ b/src/other_tools/ops_maps/git_tree_fetch_map.hpp
@@ -60,7 +60,7 @@ using GitTreeFetchMap = AsyncMapConsumer<GitTreeInfo, bool>;
gsl::not_null<ImportToGitMap*> const& import_to_git_map,
std::string const& git_bin,
std::vector<std::string> const& launcher,
- std::optional<gsl::not_null<const ServeApi*>> const& serve,
+ std::optional<ServeApi> const& serve,
gsl::not_null<IExecutionApi*> const& local_api,
std::optional<gsl::not_null<IExecutionApi*>> const& remote_api,
bool backup_to_remote,