summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/common/execution_api.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-11-06 17:17:24 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-11-07 17:31:15 +0100
commit2a4f895b4e7839c54d1b7255e8cea846b055b549 (patch)
treee59fdce2f0276529197d108e61c9f27e482e3625 /src/buildtool/execution_api/common/execution_api.hpp
parent93cb5e3de9e142ceb6ef2baafa2046e917540563 (diff)
downloadjustbuild-2a4f895b4e7839c54d1b7255e8cea846b055b549.tar.gz
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.
Diffstat (limited to 'src/buildtool/execution_api/common/execution_api.hpp')
-rw-r--r--src/buildtool/execution_api/common/execution_api.hpp9
1 files changed, 9 insertions, 0 deletions
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<Artifact::ObjectInfo> const& artifacts_info,
gsl::not_null<IExecutionApi*> 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<Artifact::ObjectInfo> const& artifacts_info,
+ gsl::not_null<IExecutionApi*> 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(