Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Modify the return value of partId function (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
laura-ding committed Jul 23, 2021
1 parent 7d9ad67 commit cd95d08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/common/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ void MetaClient::loadRemoteListeners() {

/// ================================== public methods =================================

StatusOr<PartitionID> MetaClient::partId(int32_t numParts, const VertexID id) const {
PartitionID MetaClient::partId(int32_t numParts, const VertexID id) const {
// If the length of the id is 8, we will treat it as int64_t to be compatible
// with the version 1.0
uint64_t vid = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/common/clients/meta/MetaClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ class MetaClient {

StatusOr<int32_t> partsNum(GraphSpaceID spaceId) const;

StatusOr<PartitionID> partId(int32_t numParts, VertexID id) const;
PartitionID partId(int32_t numParts, VertexID id) const;

StatusOr<std::shared_ptr<const NebulaSchemaProvider>>
getTagSchemaFromCache(GraphSpaceID spaceId, TagID tagID, SchemaVer ver = -1);
Expand Down
7 changes: 2 additions & 5 deletions src/common/clients/storage/InternalStorageClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,10 @@ folly::SemiFuture<ErrOrVal> InternalStorageClient::getValue(size_t vIdLen,
folly::StringPiece key,
folly::EventBase* evb) {
auto srcVid = key.subpiece(sizeof(PartitionID), vIdLen);
auto stPartId = metaClient_->partId(spaceId, srcVid.str());
if (!stPartId.ok()) {
return nebula::cpp2::ErrorCode::E_SPACE_NOT_FOUND;
}
auto partId = metaClient_->partId(spaceId, srcVid.str());

auto c = folly::makePromiseContract<ErrOrVal>();
getValueImpl(spaceId, stPartId.value(), key.str(), std::move(c.first), evb);
getValueImpl(spaceId, partId, key.str(), std::move(c.first), evb);
return std::move(c.second);
}

Expand Down

0 comments on commit cd95d08

Please sign in to comment.