summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_api/common/bytestream_utils.cpp9
-rw-r--r--src/buildtool/execution_api/common/bytestream_utils.hpp4
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_cas_client.cpp19
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp2
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_network.cpp6
5 files changed, 9 insertions, 31 deletions
diff --git a/src/buildtool/execution_api/common/bytestream_utils.cpp b/src/buildtool/execution_api/common/bytestream_utils.cpp
index b21d8133..2afc3e60 100644
--- a/src/buildtool/execution_api/common/bytestream_utils.cpp
+++ b/src/buildtool/execution_api/common/bytestream_utils.cpp
@@ -115,15 +115,6 @@ auto ByteStreamUtils::ReadRequest::GetDigest(HashFunction::Type hash_type)
ByteStreamUtils::WriteRequest::WriteRequest(
std::string instance_name,
std::string uuid,
- bazel_re::Digest const& digest) noexcept
- : instance_name_{std::move(instance_name)},
- uuid_{std::move(uuid)},
- hash_{digest.hash()},
- size_{static_cast<std::size_t>(digest.size_bytes())} {}
-
-ByteStreamUtils::WriteRequest::WriteRequest(
- std::string instance_name,
- std::string uuid,
ArtifactDigest const& digest) noexcept
: instance_name_{std::move(instance_name)},
uuid_{std::move(uuid)},
diff --git a/src/buildtool/execution_api/common/bytestream_utils.hpp b/src/buildtool/execution_api/common/bytestream_utils.hpp
index 16904f4f..ecfd2a97 100644
--- a/src/buildtool/execution_api/common/bytestream_utils.hpp
+++ b/src/buildtool/execution_api/common/bytestream_utils.hpp
@@ -79,10 +79,6 @@ class ByteStreamUtils final {
public:
explicit WriteRequest(std::string instance_name,
std::string uuid,
- bazel_re::Digest const& digest) noexcept;
-
- explicit WriteRequest(std::string instance_name,
- std::string uuid,
ArtifactDigest const& digest) noexcept;
[[nodiscard]] auto ToString() && noexcept -> std::string;
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_cas_client.cpp b/src/buildtool/execution_api/remote/bazel/bazel_cas_client.cpp
index dc920bca..f6919488 100644
--- a/src/buildtool/execution_api/remote/bazel/bazel_cas_client.cpp
+++ b/src/buildtool/execution_api/remote/bazel/bazel_cas_client.cpp
@@ -302,7 +302,7 @@ auto BazelCasClient::GetTree(std::string const& instance_name,
}
auto BazelCasClient::UpdateSingleBlob(std::string const& instance_name,
- BazelBlob const& blob) const noexcept
+ ArtifactBlob const& blob) const noexcept
-> bool {
logger_.Emit(LogLevel::Trace, [&blob]() {
std::ostringstream oss{};
@@ -327,7 +327,7 @@ auto BazelCasClient::UpdateSingleBlob(std::string const& instance_name,
logger_.Emit(LogLevel::Error,
"Failed to write {}:{}",
blob.digest.hash(),
- blob.digest.size_bytes());
+ blob.digest.size());
}
return ok;
}
@@ -587,16 +587,11 @@ auto BazelCasClient::BatchUpdateBlobs(std::string const& instance_name,
// trying that again; instead, we fall back to uploading each blob
// sequentially.
logger_.Emit(LogLevel::Debug, "Falling back to sequential blob upload");
- return std::count_if(
- blobs.begin(),
- blobs.end(),
- [this, &instance_name](ArtifactBlob const& blob) {
- BazelBlob bazel_blob{
- ArtifactDigestFactory::ToBazel(blob.digest),
- blob.data,
- blob.is_exec};
- return UpdateSingleBlob(instance_name, bazel_blob);
- });
+ return std::count_if(blobs.begin(),
+ blobs.end(),
+ [this, &instance_name](ArtifactBlob const& blob) {
+ return UpdateSingleBlob(instance_name, blob);
+ });
}
return updated.size();
}
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp b/src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp
index 41b323d2..abde3ae2 100644
--- a/src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp
+++ b/src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp
@@ -88,7 +88,7 @@ class BazelCasClient {
/// \param[in] blob The blob to upload
/// \returns Boolean indicating successful upload
[[nodiscard]] auto UpdateSingleBlob(std::string const& instance_name,
- BazelBlob const& blob) const noexcept
+ ArtifactBlob const& blob) const noexcept
-> bool;
/// \brief Read single blob via incremental bytestream reader
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_network.cpp b/src/buildtool/execution_api/remote/bazel/bazel_network.cpp
index 1f65201c..b435fb8e 100644
--- a/src/buildtool/execution_api/remote/bazel/bazel_network.cpp
+++ b/src/buildtool/execution_api/remote/bazel/bazel_network.cpp
@@ -18,7 +18,6 @@
#include <utility>
#include "src/buildtool/common/artifact_digest_factory.hpp"
-#include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp"
#include "src/buildtool/execution_api/common/content_blob_container.hpp"
#include "src/buildtool/execution_api/common/message_limits.hpp"
#include "src/buildtool/logging/log_level.hpp"
@@ -105,10 +104,7 @@ auto BazelNetwork::DoUploadBlobs(
}
for (auto const& it : to_stream) {
- BazelBlob bazel_blob{ArtifactDigestFactory::ToBazel(it->digest),
- it->data,
- it->is_exec};
- if (not cas_->UpdateSingleBlob(instance_name_, bazel_blob)) {
+ if (not cas_->UpdateSingleBlob(instance_name_, *it)) {
return false;
}
blobs.erase(it);