diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-21 16:18:47 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-27 09:03:30 +0100 |
commit | a8a167cb206f6c66e52ab4e92e0939e91b8dfed8 (patch) | |
tree | 7861406725739f45a98c1312ed45264bb10b9b35 /src/buildtool/execution_api/common/common_api.cpp | |
parent | e1880bead60d433de2960104bd62cd9e27bfca17 (diff) | |
download | justbuild-a8a167cb206f6c66e52ab4e92e0939e91b8dfed8.tar.gz |
ArtifactBlob: Convert to a class
Diffstat (limited to 'src/buildtool/execution_api/common/common_api.cpp')
-rw-r--r-- | src/buildtool/execution_api/common/common_api.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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 |