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

Modify the return value of partId function #591

Merged
merged 1 commit into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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