From 2a4f895b4e7839c54d1b7255e8cea846b055b549 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 6 Nov 2023 17:17:24 +0100 Subject: remote api: support otpional parallel CAS synchronisation Allow implementations to use a given number of threads to carry out the synchronisation. In this way parallelism can be achieved even in situations where batch reading degrades as objects of unknown size have to be fetched; this situation typically occurs if a tree object has a large number of direct children that are blobs. If no implementation is provided, the default implementation is to fall back to the normal (sequential) CAS synchronisation. --- src/buildtool/execution_api/common/execution_api.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/buildtool/execution_api/common/execution_api.hpp') diff --git a/src/buildtool/execution_api/common/execution_api.hpp b/src/buildtool/execution_api/common/execution_api.hpp index a8ba8009..e30c1276 100644 --- a/src/buildtool/execution_api/common/execution_api.hpp +++ b/src/buildtool/execution_api/common/execution_api.hpp @@ -87,6 +87,15 @@ class IExecutionApi { std::vector const& artifacts_info, gsl::not_null const& api) noexcept -> bool = 0; + /// \brief A variant of RetrieveToCas that is allowed to internally use + /// the specified number of threads to carry out the task in parallel. + [[nodiscard]] virtual auto ParallelRetrieveToCas( + std::vector const& artifacts_info, + gsl::not_null const& api, + std::size_t /* jobs */) noexcept -> bool { + return RetrieveToCas(artifacts_info, api); + } + /// \brief Retrieve one artifact from CAS and make it available for /// furter in-memory processing [[nodiscard]] virtual auto RetrieveToMemory( -- cgit v1.2.3