mononoke: rename blobrepo functions

Summary: We are going to use them to fetch not only file blobs, but also tree blobs.

Reviewed By: kulshrax

Differential Revision: D6336010

fbshipit-source-id: 77fcc45698a447c10d180baf929465f1d7e4ee72
This commit is contained in:
Stanislau Hlebik 2017-11-16 03:59:17 -08:00 committed by Facebook Github Bot
parent 3dc2bd685e
commit 2560d9ce73
3 changed files with 5 additions and 8 deletions

View File

@ -28,10 +28,7 @@ pub struct BlobEntry<B> {
ty: Type,
}
pub fn fetch_file_blob_from_blobstore<B>(
blobstore: B,
nodeid: NodeHash,
) -> BoxFuture<Vec<u8>, Error>
pub fn fetch_blob_from_blobstore<B>(blobstore: B, nodeid: NodeHash) -> BoxFuture<Vec<u8>, Error>
where
B: Blobstore<Key = String> + Clone,
{

View File

@ -21,7 +21,7 @@ use BlobChangeset;
use BlobManifest;
use BlobState;
use errors::*;
use file::fetch_file_blob_from_blobstore;
use file::fetch_blob_from_blobstore;
pub struct BlobRepo<State> {
inner: Arc<State>,
@ -39,8 +39,8 @@ impl<State> BlobRepo<State>
where
State: BlobState,
{
pub fn get_file_blob(&self, key: &NodeHash) -> BoxFuture<Vec<u8>, Error> {
fetch_file_blob_from_blobstore(self.inner.blobstore().clone(), *key)
pub fn get_blob(&self, key: &NodeHash) -> BoxFuture<Vec<u8>, Error> {
fetch_blob_from_blobstore(self.inner.blobstore().clone(), *key)
}
}

View File

@ -239,7 +239,7 @@ where
}
};
repo.get_file_blob(hash)
repo.get_blob(hash)
.from_err()
.and_then(|content| futures::future::ok(content))
.boxify()