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

Extend CAS in Raft #800

Merged
merged 2 commits into from
Aug 21, 2019
Merged

Extend CAS in Raft #800

merged 2 commits into from
Aug 21, 2019

Conversation

dangleptr
Copy link
Contributor

  1. Support more atomic operations not only cas
  2. We could pass the atomic operator into raft, and it will be invoked atomically.

@nebula-community-bot
Copy link
Member

Unit testing passed.

auto casRet = compareAndSet(log);
if (casRet.empty()) {
[this] (AtomicOp op) -> std::string {
auto opRet = op();
Copy link
Contributor

Choose a reason for hiding this comment

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

According to my understanding, in AtomicOp, user just define whatever they want to do atomically, and return the result as a string.
Why don't we just pass the AtomicOp instead of folly::Function<std::string(AtomicOp op)> opCB, it seems a little bit weird.

Copy link
Contributor Author

@dangleptr dangleptr Aug 19, 2019

Choose a reason for hiding this comment

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

Because we will set promise value, if we implement the logic directly in Iterator, you have to pass the whole part into it. This is not what we want.

Copy link
Contributor

@darionyaphet darionyaphet left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@critical27 critical27 left a comment

Choose a reason for hiding this comment

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

LGTM

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dangleptr dangleptr merged commit 91971ca into vesoft-inc:master Aug 21, 2019
@dangleptr dangleptr deleted the cas branch August 21, 2019 06:43
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
liwenhui-soul pushed a commit to liwenhui-soul/nebula that referenced this pull request May 10, 2022
* optimize bfs

* optimizer allpath

* optimizer multi-shortestpath

* optimizer multi shortest path

* fix validate unit test

* add some comment

* fix error

* fix bfs error

* add comment

* delete conjunct

* add findpath unit test

* delete useless file

* delete log

* remove check

* multi thread executor

* single shortest multi thread

* add some testcases

* add gflags

* fix bfs error

* address comment

Co-authored-by: jimingquan <mingquan.ji@vesoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants