File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -248,6 +248,33 @@ FakeBackingStore::getBlobAuxData(
248248 .semi ();
249249}
250250
251+ folly::coro::now_task<BackingStore::GetBlobAuxResult>
252+ FakeBackingStore::co_getBlobAuxData (
253+ const ObjectId& id,
254+ const ObjectFetchContextPtr& context) {
255+ {
256+ auto data = data_.wlock ();
257+ data->auxDataLookups .push_back (id);
258+ }
259+
260+ if (serverState_) {
261+ co_await serverState_->getFaultInjector ().co_checkAsync (
262+ " getBlobAuxData" , id);
263+ }
264+
265+ auto blobResult = co_await co_getBlob (id, context);
266+ co_return BackingStore::GetBlobAuxResult{
267+ std::make_shared<BlobAuxDataPtr::element_type>(
268+ Hash20::sha1 (blobResult.blob ->getContents ()),
269+ blake3Key_ ? Hash32::keyedBlake3 (
270+ folly::ByteRange{folly::StringPiece{
271+ blake3Key_->data (), blake3Key_->size ()}},
272+ blobResult.blob ->getContents ())
273+ : Hash32::blake3 (blobResult.blob ->getContents ()),
274+ blobResult.blob ->getSize ()),
275+ blobResult.origin };
276+ }
277+
251278ImmediateFuture<BackingStore::GetGlobFilesResult>
252279FakeBackingStore::getGlobFiles (
253280 const RootId& id,
Original file line number Diff line number Diff line change @@ -251,6 +251,9 @@ class FakeBackingStore final : public BackingStore {
251251 folly::SemiFuture<GetBlobAuxResult> getBlobAuxData (
252252 const ObjectId& id,
253253 const ObjectFetchContextPtr& context) override ;
254+ folly::coro::now_task<GetBlobAuxResult> co_getBlobAuxData (
255+ const ObjectId& id,
256+ const ObjectFetchContextPtr& context);
254257 ImmediateFuture<GetGlobFilesResult> getGlobFiles (
255258 const RootId& id,
256259 const std::vector<std::string>& globs,
You can’t perform that action at this time.
0 commit comments