Page MenuHomePhabricator

[services][backup] Add Put client convenience helpers
ClosedPublic

Authored by bartek on Jan 4 2023, 9:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 2 2024, 11:59 PM
Subscribers

Details

Summary

Added some convenience helper functions to make it easier to works with Blob put client.
One method creates a simple put client, which is automatically supplied with holder and blob hash, where hash=holder.
These will be used later, especially when uploading logs, when such client is going to be instantiated
multiple times.

Depends on D6167

Test Plan

This code is tested in subsequent diffs where it is used in backup service ednpoints.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Jan 4 2023, 9:25 AM
  • Add blob_hash arg to start_simple_put_client to make it more flexible
  • Terminate early if data_exists
tomek added inline comments.
services/backup/src/blob/put_client.rs
144–147 ↗(On Diff #20655)

Can't we use put_data here?

This revision is now accepted and ready to land.Jan 9 2023, 6:59 AM
services/backup/src/blob/put_client.rs
144–147 ↗(On Diff #20655)

Not really, the put_data is for PutRequestData::DataChunk(...) and we have a Holder here. Fortunately, this function is the only place we put anything other than data chunks, so I wouldn't add any other convenience helpers.