From 55ba09ec97d2449b39d7fcc38c346969168d899b Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Mon, 27 Feb 2023 10:27:52 +0100 Subject: execution service: implement WaitExecution and google::longrunning::Operations::GetOperation For each action that is executed, an entry is added to a shared thread safe cache. Once the number of operations stored exceeds twice 2^n, where n is given by the option --log-operations-threshold, at most 2^n operations will be removed, in a FIFO scheme. --- .../execution_api/execution_service/execution_server.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/buildtool/execution_api/execution_service/execution_server.hpp') diff --git a/src/buildtool/execution_api/execution_service/execution_server.hpp b/src/buildtool/execution_api/execution_service/execution_server.hpp index d0ec5074..65ace208 100644 --- a/src/buildtool/execution_api/execution_service/execution_server.hpp +++ b/src/buildtool/execution_api/execution_service/execution_server.hpp @@ -107,6 +107,10 @@ class ExecutionServiceImpl final : public bazel_re::Execution::Service { -> ::grpc::Status override; private: + LocalStorage storage_{}; + IExecutionApi::Ptr api_{new LocalApi()}; + Logger logger_{"execution-service"}; + [[nodiscard]] auto GetAction(::bazel_re::ExecuteRequest const* request) const noexcept -> std::pair, std::optional>; @@ -126,21 +130,17 @@ class ExecutionServiceImpl final : public bazel_re::Execution::Service { -> std::pair, std::optional>; - [[nodiscard]] auto WriteResponse( + [[nodiscard]] auto StoreActionResult( ::bazel_re::ExecuteRequest const* request, IExecutionResponse::Ptr const& i_execution_response, - ::bazel_re::Action const& action, - ::grpc::ServerWriter<::google::longrunning::Operation>* writer) - const noexcept -> std::optional; + ::bazel_re::ExecuteResponse const& execute_response, + ::bazel_re::Action const& action) const noexcept + -> std::optional; [[nodiscard]] auto AddResult( ::bazel_re::ExecuteResponse* response, IExecutionResponse::Ptr const& i_execution_response, std::string const& hash) const noexcept -> std::optional; - - LocalStorage storage_{}; - IExecutionApi::Ptr api_{new LocalApi()}; - Logger logger_{"execution-service"}; }; #endif -- cgit v1.2.3