diff options
Diffstat (limited to 'src/buildtool/execution_api/common')
-rw-r--r-- | src/buildtool/execution_api/common/blob_tree.cpp | 3 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/blob_tree.hpp | 2 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/common_api.cpp | 12 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/buildtool/execution_api/common/blob_tree.cpp b/src/buildtool/execution_api/common/blob_tree.cpp index a0d362b4..7224406a 100644 --- a/src/buildtool/execution_api/common/blob_tree.cpp +++ b/src/buildtool/execution_api/common/blob_tree.cpp @@ -43,7 +43,8 @@ auto BlobTree::FromDirectoryTree(DirectoryTreePtr const& tree, if (not blob_tree) { return std::nullopt; } - auto raw_id = FromHexString((*blob_tree)->Blob().digest.hash()); + auto raw_id = + FromHexString((*blob_tree)->blob_.GetDigest().hash()); if (not raw_id) { return std::nullopt; } diff --git a/src/buildtool/execution_api/common/blob_tree.hpp b/src/buildtool/execution_api/common/blob_tree.hpp index 47b3c3ae..2d5a8a25 100644 --- a/src/buildtool/execution_api/common/blob_tree.hpp +++ b/src/buildtool/execution_api/common/blob_tree.hpp @@ -38,7 +38,7 @@ class BlobTree { [[nodiscard]] auto Blob() const noexcept -> ArtifactBlob { return blob_; } [[nodiscard]] auto IsTree() const noexcept -> bool { - return blob_.digest.IsTree(); + return blob_.GetDigest().IsTree(); } /// \brief Create a `BlobTree` from a `DirectoryTree`. diff --git a/src/buildtool/execution_api/common/common_api.cpp b/src/buildtool/execution_api/common/common_api.cpp index 1c696731..68b49be3 100644 --- a/src/buildtool/execution_api/common/common_api.cpp +++ b/src/buildtool/execution_api/common/common_api.cpp @@ -106,7 +106,7 @@ auto CommonUploadBlobTree(BlobTreePtr const& blob_tree, { auto back_map = BackMap<ArtifactDigest, BlobTreePtr>::Make( &*blob_tree, - [](BlobTreePtr const& node) { return node->Blob().digest; }); + [](BlobTreePtr const& node) { return node->Blob().GetDigest(); }); if (back_map == nullptr) { Logger::Log(LogLevel::Error, "Failed to retrieve the missing tree blobs for upload"); @@ -188,7 +188,7 @@ auto CommonUploadTreeNative(IExecutionApi const& api, auto tree_blob = (*blob_tree)->Blob(); // Upload blob tree if tree is not available at the remote side (content // first). - if (not api.IsAvailable(tree_blob.digest)) { + if (not api.IsAvailable(tree_blob.GetDigest())) { if (not CommonUploadBlobTree(*blob_tree, api)) { Logger::Log(LogLevel::Debug, "failed to upload blob tree for build root."); @@ -201,7 +201,7 @@ auto CommonUploadTreeNative(IExecutionApi const& api, return std::nullopt; } } - return tree_blob.digest; + return tree_blob.GetDigest(); } auto UpdateContainerAndUpload( @@ -214,7 +214,7 @@ auto UpdateContainerAndUpload( // that we never store unnecessarily more data in the container than we need // per remote transfer. try { - if (blob.data->size() > MessageLimits::kMaxGrpcLength) { + if (blob.GetContentSize() > MessageLimits::kMaxGrpcLength) { // large blobs use individual stream upload if (not uploader( std::unordered_set<ArtifactBlob>{{std::move(blob)}})) { @@ -225,10 +225,10 @@ auto UpdateContainerAndUpload( if (not container->contains(blob)) { std::size_t content_size = 0; for (auto const& blob : *container) { - content_size += blob.data->size(); + content_size += blob.GetContentSize(); } - if (content_size + blob.data->size() > + if (content_size + blob.GetContentSize() > MessageLimits::kMaxGrpcLength) { // swap away from original container to allow move during // upload |