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)
Fri, Dec 20, 6:11 AM
Unknown Object (File)
Fri, Dec 20, 4:27 AM
Unknown Object (File)
Tue, Dec 17, 4:59 PM
Unknown Object (File)
Fri, Dec 13, 10:57 AM
Unknown Object (File)
Sun, Dec 8, 2:30 AM
Unknown Object (File)
Mon, Dec 2, 3:03 AM
Unknown Object (File)
Sat, Nov 30, 10:09 AM
Unknown Object (File)
Sat, Nov 30, 10:09 AM
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.