sapling/eden/mononoke/blobstore
Thomas Orozco ee2e6fd8e2 mononoke/blobrepo: make RepoBlobstore an actual struct
Summary:
RepoBlobstore is currently a type alias for the underlying blobstore type. This
is a bit unideal for a few reasons:

- It means we can't add convenience methods on it. Notably, getting access to
  the underlying blobstore can be helpful in tests, but as-is we cannot do that
  (see the test that I updated in the LFS server change in this diff for an
  example).
- Since the various blobstores we use for wrapping are blobstores themselves,
  it is possible when deconstructing the repo blobstore to accidentally forget
  to remove one layer. By making the internal blobstore a `T`, we can let the
  compiler prove that deconstructing the `RepoBlobstore` is done properly.

Most of the changes in this diff are slight refactorings to make this compile
(e.g. removing obsolete trait bounds, etc.), but there are a couple functional
changes:

- I've extracted the RedactedBlobstore configuration into its own Arc. This
  enables us to pull it back out of a RedactedBlobstore without having to copy
  the actual data that's in it.
- I've removed `as_inner()` and `into_inner()` from `RedactedBlobstore`. Those
  methods didn't really make sense. They had 2 use cases:
  - Deconstruct the `RedactedBlobstore` (to rebuild a new blobstore). This is
    better handled by `as_parts()`.
  - Get the underlying blobstore to make a request. This is better handled by
    yielding the blobstore when checking for access, which also ensures you
    cannot accidentally bypass redaction by using `as_inner()` (this which also
    allowed me to remove a clone on blobstore in the process).

Reviewed By: farnz

Differential Revision: D20941351

fbshipit-source-id: 9fa566702598b916cb87be6b3f064cd7e8e0b3e0
2020-04-14 03:19:25 -07:00
..
cacheblob mononoke/blobrepo: make RepoBlobstore an actual struct 2020-04-14 03:19:25 -07:00
chaosblob blobstore: cover more blobstores to make them OSS buildable 2020-03-06 01:33:38 -08:00
context_concurrency_blobstore mononoke/blobrepo: make RepoBlobstore an actual struct 2020-04-14 03:19:25 -07:00
delayblob rust: regenerate autocargo for tokio rollback 2020-04-10 01:12:57 -07:00
factory migrate from sql_ext::SqlConstructors to sql_construct 2020-04-02 05:27:16 -07:00
fileblob blobstore: cover more blobstores to make them OSS buildable 2020-03-06 01:33:38 -08:00
if third-party/rust: Turn off async-trait/support_old_nightly 2020-04-02 17:01:24 -07:00
memblob blobstore: cover more blobstores to make them OSS buildable 2020-03-06 01:33:38 -08:00
multiplexedblob migrate from sql_ext::SqlConstructors to sql_construct 2020-04-02 05:27:16 -07:00
prefixblob mononoke/blobrepo: make RepoBlobstore an actual struct 2020-04-14 03:19:25 -07:00
readonlyblob blobstore: cover more blobstores to make them OSS buildable 2020-03-06 01:33:38 -08:00
redactedblobstore mononoke/blobrepo: make RepoBlobstore an actual struct 2020-04-14 03:19:25 -07:00
samplingblob mononoke: add default implementations for samplingblobs put and is_present handlers 2020-04-06 10:01:38 -07:00
sqlblob third-party/rust: Turn off async-trait/support_old_nightly 2020-04-02 17:01:24 -07:00
src mononoke: move StoreLoadable and add LodableError 2020-03-23 00:43:44 -07:00
test mononoke/blobstore: remove rocksdb blobstore and replace its usages with sqliteblob 2020-02-24 05:23:07 -08:00
throttledblob blobstore: cover more blobstores to make them OSS buildable 2020-03-06 01:33:38 -08:00
Cargo.toml blobstore: cover more blobstores to make them OSS buildable 2020-03-06 01:33:38 -08:00