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

GetDstBySrc #4531

Merged
merged 6 commits into from
Aug 18, 2022
Merged

GetDstBySrc #4531

merged 6 commits into from
Aug 18, 2022

Conversation

critical27
Copy link
Contributor

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Subtask of #4525

Description:

Add a new rpc interface called GetDstBySrc, the difference between it and GetNeighbors is that it only return dst of the edge in each row (even the srcId is not returned), see the interface in storage.thrift for details. And the dst has been deduped before returned to graphd to minimize memory cost.

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

Copy link
Contributor

@jievince jievince left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

auto props = context_->props_;
DCHECK_EQ(props->size(), 1);

nebula::List list;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nebula::Row is more clear.

@@ -48,9 +48,6 @@ class MultiTagNode : public IterateNode<VertexID> {

// add result of each tag node to tagResult
for (auto* tagNode : tagNodes_) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same Q

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They have been check on a higher level node, this is redundant. All the check only exists in output node, just to keep unify with others

Copy link
Contributor

@pengweisong pengweisong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

@wenhaocs
Copy link
Contributor

Generally, can you reuse getNeighbors but make kVid optional, ie. set kVid only when it's specified in req?

@jievince
Copy link
Contributor

ee the interfac

They are different in memory occupation. See https://confluence.nebula-graph.io/pages/viewpage.action?pageId=47392379

@jievince jievince requested a review from dutor August 18, 2022 02:32
@wenhaocs
Copy link
Contributor

wenhaocs commented Aug 18, 2022

ee the interfac

They are different in memory occupation. See https://confluence.nebula-graph.io/pages/viewpage.action?pageId=47392379

The response seems like the same:
image

vs.

image

The only difference is in request. But you can mark only returning kDst in the request.

@jievince
Copy link
Contributor

image
GetNeighbors takes up more memory.

@critical27
Copy link
Contributor Author

Generally, can you reuse getNeighbors but make kVid optional, ie. set kVid only when it's specified in req?

We could indeed, there are several slight difference between them:

  1. return format as @jievince mentioned
  2. the StoragePlan is simplified for GetDstBySrc
  3. the output has been deduped in GetDstBySrc, which we don't do it in getNeighbors
  4. most of all, this interface is used for the interim result for the first (N - 1) steps in go N steps, if we reuse GetNeighbors, the impact will be not be trival

Copy link
Contributor

@dutor dutor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@dutor dutor merged commit af1e1e8 into vesoft-inc:master Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants