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)
Sun, Nov 10, 10:05 PM
Unknown Object (File)
Sun, Nov 10, 3:48 PM
Unknown Object (File)
Sat, Nov 9, 5:43 PM
Unknown Object (File)
Sat, Nov 9, 2:20 PM
Unknown Object (File)
Sat, Nov 9, 2:20 PM
Unknown Object (File)
Sat, Nov 9, 12:41 PM
Unknown Object (File)
Sat, Nov 9, 11:57 AM
Unknown Object (File)
Sat, Nov 9, 11:57 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.