mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
remove debugGetScmBlobMetadata
Summary: I migrated the last caller of debugGetScmBlobMetadata to debugGetBlobMetadata in the last diff. Let's delete the old method. I am not really concerned about waiting for that lower diff to rollout and all because this is a debugging command that we only sparingly ask users to run (As far as I know like maybe 3 times). Reviewed By: chadaustin Differential Revision: D45972617 fbshipit-source-id: 6d4689a225fee972f8e3a802115852043f0bade8
This commit is contained in:
parent
5458cd7045
commit
5dac894df8
@ -3055,38 +3055,6 @@ EdenServiceHandler::semifuture_debugGetBlob(
|
||||
.semi();
|
||||
}
|
||||
|
||||
void EdenServiceHandler::debugGetScmBlobMetadata(
|
||||
ScmBlobMetadata& result,
|
||||
unique_ptr<string> mountPoint,
|
||||
unique_ptr<string> idStr,
|
||||
bool localStoreOnly) {
|
||||
auto helper = INSTRUMENT_THRIFT_CALL(DBG2, *mountPoint, logHash(*idStr));
|
||||
auto mountHandle = lookupMount(mountPoint);
|
||||
auto& store = mountHandle.getObjectStore();
|
||||
auto id = store.parseObjectId(*idStr);
|
||||
|
||||
std::optional<BlobMetadata> metadata;
|
||||
if (localStoreOnly) {
|
||||
auto localStore = server_->getLocalStore();
|
||||
metadata = *localStore->getBlobMetadata(id).get();
|
||||
} else {
|
||||
auto& fetchContext = helper->getFetchContext();
|
||||
auto sha1 = store.getBlobSha1(id, fetchContext).get();
|
||||
auto size = store.getBlobSize(id, fetchContext).get();
|
||||
metadata.emplace(sha1, size);
|
||||
}
|
||||
|
||||
if (!metadata.has_value()) {
|
||||
throw newEdenError(
|
||||
ENOENT,
|
||||
EdenErrorType::POSIX_ERROR,
|
||||
"no blob metadata found for id ",
|
||||
id);
|
||||
}
|
||||
result.size_ref() = metadata->size;
|
||||
result.contentsSha1_ref() = thriftHash20(metadata->sha1);
|
||||
}
|
||||
|
||||
folly::SemiFuture<std::unique_ptr<DebugGetBlobMetadataResponse>>
|
||||
EdenServiceHandler::semifuture_debugGetBlobMetadata(
|
||||
std::unique_ptr<DebugGetBlobMetadataRequest> request) {
|
||||
|
@ -246,12 +246,6 @@ class EdenServiceHandler : virtual public StreamingEdenServiceSvIf,
|
||||
semifuture_debugGetBlob(
|
||||
std::unique_ptr<DebugGetScmBlobRequest> request) override;
|
||||
|
||||
void debugGetScmBlobMetadata(
|
||||
ScmBlobMetadata& metadata,
|
||||
std::unique_ptr<std::string> mountPoint,
|
||||
std::unique_ptr<std::string> id,
|
||||
bool localStoreOnly) override;
|
||||
|
||||
folly::SemiFuture<std::unique_ptr<DebugGetBlobMetadataResponse>>
|
||||
semifuture_debugGetBlobMetadata(
|
||||
std::unique_ptr<DebugGetBlobMetadataRequest> request) override;
|
||||
|
@ -1944,23 +1944,6 @@ service EdenService extends fb303_core.BaseService {
|
||||
1: DebugGetScmBlobRequest request,
|
||||
) throws (1: EdenError ex);
|
||||
|
||||
/**
|
||||
* DEPRECATED -- use debugGetBlobMetadata instead.
|
||||
* TODO: Remove Febuary 2023.
|
||||
*
|
||||
* Get the metadata about a source control Blob.
|
||||
*
|
||||
* This retrieves the metadata about a source control Blob. This returns
|
||||
* the size and contents SHA1 of the blob, which eden stores separately from
|
||||
* the blob itself. This can also be a useful alternative to
|
||||
* debugGetScmBlob() when getting data about extremely large blobs.
|
||||
*/
|
||||
ScmBlobMetadata debugGetScmBlobMetadata(
|
||||
1: PathString mountPoint,
|
||||
2: ThriftObjectId id,
|
||||
3: bool localStoreOnly,
|
||||
) throws (1: EdenError ex);
|
||||
|
||||
/**
|
||||
* Get the metadata about a source control Blob.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user