Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only write vertex key when flag is set or explictly insert vertex #4680

Merged
merged 1 commit into from
Sep 27, 2022
Merged
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
6 changes: 4 additions & 2 deletions src/storage/mutate/AddVerticesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ void AddVerticesProcessor::process(const cpp2::AddVerticesRequest& req) {
void AddVerticesProcessor::doProcess(const cpp2::AddVerticesRequest& req) {
const auto& partVertices = req.get_parts();
const auto& propNamesMap = req.get_prop_names();
bool onlyVertex = propNamesMap.empty();
for (auto& part : partVertices) {
auto partId = part.first;
const auto& vertices = part.second;
Expand All @@ -81,7 +82,7 @@ void AddVerticesProcessor::doProcess(const cpp2::AddVerticesRequest& req) {
code = nebula::cpp2::ErrorCode::E_INVALID_VID;
break;
}
if (FLAGS_use_vertex_key) {
if (onlyVertex || FLAGS_use_vertex_key) {
data.emplace_back(NebulaKeyUtils::vertexKey(spaceVidLen_, partId, vid), "");
}
for (auto& newTag : newTags) {
Expand Down Expand Up @@ -139,6 +140,7 @@ void AddVerticesProcessor::doProcess(const cpp2::AddVerticesRequest& req) {
void AddVerticesProcessor::doProcessWithIndex(const cpp2::AddVerticesRequest& req) {
const auto& partVertices = req.get_parts();
const auto& propNamesMap = req.get_prop_names();
bool onlyVertex = propNamesMap.empty();

for (const auto& part : partVertices) {
auto partId = part.first;
Expand All @@ -161,7 +163,7 @@ void AddVerticesProcessor::doProcessWithIndex(const cpp2::AddVerticesRequest& re
code = nebula::cpp2::ErrorCode::E_INVALID_VID;
break;
}
if (FLAGS_use_vertex_key) {
if (onlyVertex || FLAGS_use_vertex_key) {
verticeData.emplace_back(NebulaKeyUtils::vertexKey(spaceVidLen_, partId, vid));
}
for (const auto& newTag : newTags) {
Expand Down