diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-12-11 11:33:50 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-12-12 14:37:18 +0100 |
commit | 3fdfd22e7f02effbf28ad99b00e4916ae6f4b4ad (patch) | |
tree | 793686e03f90e67b103713cfafa7c03743ac7311 /src/buildtool/serve_api/serve_service/target.hpp | |
parent | 21a0e5ca4c9bb8d8b92822fac7d8dc66b5a4e0e8 (diff) | |
download | justbuild-3fdfd22e7f02effbf28ad99b00e4916ae6f4b4ad.tar.gz |
serve target: Update server-side to compute correct target cache shard
Diffstat (limited to 'src/buildtool/serve_api/serve_service/target.hpp')
-rw-r--r-- | src/buildtool/serve_api/serve_service/target.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/buildtool/serve_api/serve_service/target.hpp b/src/buildtool/serve_api/serve_service/target.hpp index b8257152..ef58e841 100644 --- a/src/buildtool/serve_api/serve_service/target.hpp +++ b/src/buildtool/serve_api/serve_service/target.hpp @@ -16,12 +16,17 @@ #define INCLUDED_SRC_BUILD_SERVE_API_SERVE_SERVICE_TARGET_HPP #include <filesystem> +#include <map> #include <memory> #include <optional> #include <string> +#include <utility> +#include <variant> #include "gsl/gsl" #include "justbuild/just_serve/just_serve.grpc.pb.h" +#include "nlohmann/json.hpp" +#include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/remote/remote_common.hpp" #include "src/buildtool/execution_api/common/create_execution_api.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" @@ -78,6 +83,13 @@ class TargetService final : public justbuild::just_serve::Target::Service { // used for storing and retrieving target-level cache entries gsl::not_null<IExecutionApi::Ptr> const local_api_{ CreateExecutionApi(std::nullopt)}; + + /// \brief Get from remote and parse the endpoint configuration. The method + /// also ensures the content has the expected format. + /// \returns An error + data union, with a pair of grpc status at index 0 + /// and the dispatch list stored as a JSON object at index 1. + auto GetDispatchList(ArtifactDigest const& dispatch_digest) + -> std::variant<::grpc::Status, nlohmann::json>; }; #endif // INCLUDED_SRC_BUILD_SERVE_API_SERVE_SERVICE_TARGET_HPP |