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

check type of index #426

Merged
merged 2 commits into from
Apr 8, 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
7 changes: 7 additions & 0 deletions src/meta/processors/indexMan/GetEdgeIndexProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ void GetEdgeIndexProcessor::process(const cpp2::GetEdgeIndexReq& req) {
}

auto item = MetaServiceUtils::parseIndex(edgeResult.value());
if (item.get_schema_id().getType() != cpp2::SchemaID::Type::edge_type) {
LOG(ERROR) << "Get Edge Index Failed: Index Name " << indexName << " is not EdgeIndex";
resp_.set_code(cpp2::ErrorCode::E_NOT_FOUND);
onFinished();
return;
}

handleErrorCode(cpp2::ErrorCode::SUCCEEDED);
resp_.set_item(std::move(item));
onFinished();
Expand Down
7 changes: 7 additions & 0 deletions src/meta/processors/indexMan/GetTagIndexProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ void GetTagIndexProcessor::process(const cpp2::GetTagIndexReq& req) {
}

auto item = MetaServiceUtils::parseIndex(tagResult.value());
if (item.get_schema_id().getType() != cpp2::SchemaID::Type::tag_id) {
LOG(ERROR) << "Get Tag Index Failed: Index Name " << indexName << " is not TagIndex";
resp_.set_code(cpp2::ErrorCode::E_NOT_FOUND);
onFinished();
return;
}

handleErrorCode(cpp2::ErrorCode::SUCCEEDED);
resp_.set_item(std::move(item));
onFinished();
Expand Down