diff options
Diffstat (limited to 'src/other_tools/ops_maps')
-rw-r--r-- | src/other_tools/ops_maps/archive_fetch_map.cpp | 26 | ||||
-rw-r--r-- | src/other_tools/ops_maps/archive_fetch_map.hpp | 2 | ||||
-rw-r--r-- | src/other_tools/ops_maps/content_cas_map.cpp | 2 | ||||
-rw-r--r-- | src/other_tools/ops_maps/content_cas_map.hpp | 2 | ||||
-rw-r--r-- | src/other_tools/ops_maps/git_tree_fetch_map.cpp | 21 | ||||
-rw-r--r-- | src/other_tools/ops_maps/git_tree_fetch_map.hpp | 2 |
6 files changed, 26 insertions, 29 deletions
diff --git a/src/other_tools/ops_maps/archive_fetch_map.cpp b/src/other_tools/ops_maps/archive_fetch_map.cpp index 883ffa76..db2fc319 100644 --- a/src/other_tools/ops_maps/archive_fetch_map.cpp +++ b/src/other_tools/ops_maps/archive_fetch_map.cpp @@ -26,14 +26,13 @@ namespace { -void ProcessContent( - std::filesystem::path const& content_path, - std::filesystem::path const& target_name, - gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, - std::string const& content, - ArchiveFetchMap::SetterPtr const& setter, - ArchiveFetchMap::LoggerPtr const& logger) { +void ProcessContent(std::filesystem::path const& content_path, + std::filesystem::path const& target_name, + gsl::not_null<IExecutionApi const*> const& local_api, + IExecutionApi::OptionalPtr const& remote_api, + std::string const& content, + ArchiveFetchMap::SetterPtr const& setter, + ArchiveFetchMap::LoggerPtr const& logger) { // try to back up to remote CAS if (remote_api) { if (not local_api->RetrieveToCas( @@ -68,12 +67,11 @@ void ProcessContent( } // namespace -auto CreateArchiveFetchMap( - gsl::not_null<ContentCASMap*> const& content_cas_map, - std::filesystem::path const& fetch_dir, - gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, - std::size_t jobs) -> ArchiveFetchMap { +auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map, + std::filesystem::path const& fetch_dir, + gsl::not_null<IExecutionApi const*> const& local_api, + IExecutionApi::OptionalPtr const& remote_api, + std::size_t jobs) -> ArchiveFetchMap { auto fetch_archive = [content_cas_map, fetch_dir, local_api, remote_api]( auto ts, auto setter, diff --git a/src/other_tools/ops_maps/archive_fetch_map.hpp b/src/other_tools/ops_maps/archive_fetch_map.hpp index f6e3d987..9f0b220d 100644 --- a/src/other_tools/ops_maps/archive_fetch_map.hpp +++ b/src/other_tools/ops_maps/archive_fetch_map.hpp @@ -30,7 +30,7 @@ using ArchiveFetchMap = AsyncMapConsumer<ArchiveContent, bool>; gsl::not_null<ContentCASMap*> const& content_cas_map, std::filesystem::path const& fetch_dir, // should exist! gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, std::size_t jobs) -> ArchiveFetchMap; #endif // INCLUDED_SRC_OTHER_TOOLS_OPS_MAPS_ARCHIVE_FETCH_MAP_HPP diff --git a/src/other_tools/ops_maps/content_cas_map.cpp b/src/other_tools/ops_maps/content_cas_map.cpp index 4d1ca013..3cba65ef 100644 --- a/src/other_tools/ops_maps/content_cas_map.cpp +++ b/src/other_tools/ops_maps/content_cas_map.cpp @@ -110,7 +110,7 @@ auto CreateContentCASMap( gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, std::size_t jobs) -> ContentCASMap { auto ensure_in_cas = [just_mr_paths, additional_mirrors, diff --git a/src/other_tools/ops_maps/content_cas_map.hpp b/src/other_tools/ops_maps/content_cas_map.hpp index 25facd07..df8b0103 100644 --- a/src/other_tools/ops_maps/content_cas_map.hpp +++ b/src/other_tools/ops_maps/content_cas_map.hpp @@ -86,7 +86,7 @@ using ContentCASMap = AsyncMapConsumer<ArchiveContent, std::nullptr_t>; gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, std::size_t jobs) -> ContentCASMap; namespace std { 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 c518c9e9..b08da28a 100644 --- a/src/other_tools/ops_maps/git_tree_fetch_map.cpp +++ b/src/other_tools/ops_maps/git_tree_fetch_map.cpp @@ -63,16 +63,15 @@ void BackupToRemote(std::string const& tree_id, /// \brief Moves the root tree from local CAS to the Git cache and sets the /// root. -void MoveCASTreeToGit( - std::string const& tree_id, - ArtifactDigest const& digest, - gsl::not_null<ImportToGitMap*> const& import_to_git_map, - gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, - bool backup_to_remote, - gsl::not_null<TaskSystem*> const& ts, - GitTreeFetchMap::SetterPtr const& setter, - GitTreeFetchMap::LoggerPtr const& logger) { +void MoveCASTreeToGit(std::string const& tree_id, + ArtifactDigest const& digest, + gsl::not_null<ImportToGitMap*> const& import_to_git_map, + gsl::not_null<IExecutionApi const*> const& local_api, + IExecutionApi::OptionalPtr const& remote_api, + bool backup_to_remote, + gsl::not_null<TaskSystem*> const& ts, + GitTreeFetchMap::SetterPtr const& setter, + GitTreeFetchMap::LoggerPtr const& logger) { // Move tree from CAS to local Git storage auto tmp_dir = StorageConfig::CreateTypedTmpDir("fetch-remote-git-tree"); if (not tmp_dir) { @@ -131,7 +130,7 @@ auto CreateGitTreeFetchMap( std::vector<std::string> const& launcher, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, bool backup_to_remote, std::size_t jobs) -> GitTreeFetchMap { auto tree_to_cache = [critical_git_op_map, 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 82c858d5..be5a4252 100644 --- a/src/other_tools/ops_maps/git_tree_fetch_map.hpp +++ b/src/other_tools/ops_maps/git_tree_fetch_map.hpp @@ -62,7 +62,7 @@ using GitTreeFetchMap = AsyncMapConsumer<GitTreeInfo, bool>; std::vector<std::string> const& launcher, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, bool backup_to_remote, std::size_t jobs) -> GitTreeFetchMap; |