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

feat: add sequencer api component with snowflake algorithm #767

Merged
merged 70 commits into from
Oct 20, 2022

Conversation

OOOOlh
Copy link
Contributor

@OOOOlh OOOOlh commented Aug 16, 2022

What this PR does:
add snowflake sequencer

  • mysql
  • ringbuffer
  • uidgenerator

Which issue(s) this PR fixes:

Fixes #193

@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Base: 60.55% // Head: 60.69% // Increases project coverage by +0.14% 🎉

Coverage data is based on head (301b3c1) compared to base (18ceced).
Patch coverage: 66.08% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #767      +/-   ##
==========================================
+ Coverage   60.55%   60.69%   +0.14%     
==========================================
  Files         135      137       +2     
  Lines        8815     9101     +286     
==========================================
+ Hits         5338     5524     +186     
- Misses       2823     2889      +66     
- Partials      654      688      +34     
Impacted Files Coverage Δ
...ponents/sequencer/snowflake/snowflake_sequencer.go 65.88% <65.88%> (ø)
components/sequencer/snowflake/snowflake.go 66.16% <66.16%> (ø)
components/lock/zookeeper/zookeeper_lock.go 54.38% <0.00%> (-5.27%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ZLBer
Copy link
Member

ZLBer commented Aug 27, 2022

@OOOOlh There are several issues that need to be resolved:

  1. The function name and important steps should be commented
  2. I see that you have defined a lot of parameters, you also should explain it
  3. The test is not enough, there is only one simple test now, you need to add some more. For example: multi-concurrency, recovery in case of errors, etc.

If you are done coding, remove [WIP].

@OOOOlh
Copy link
Contributor Author

OOOOlh commented Aug 27, 2022

@ZLBer got it

@OOOOlh
Copy link
Contributor Author

OOOOlh commented Sep 2, 2022

I will add more unit tests.

@OOOOlh OOOOlh changed the title [WIP] feat:add sequencer api component with snowflake algorithm feat:add sequencer api component with snowflake algorithm Sep 5, 2022
@OOOOlh OOOOlh changed the title feat:add sequencer api component with snowflake algorithm feat: add sequencer api component with snowflake algorithm Sep 7, 2022
@seeflood seeflood requested a review from ZLBer October 19, 2022 09:57
@seeflood
Copy link
Member

@ZLBer Please review again 😘

ZLBer
ZLBer previously approved these changes Oct 19, 2022
Copy link
Member

@ZLBer ZLBer left a comment

Choose a reason for hiding this comment

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

LGTM

components/pkg/utils/snowflake.go Outdated Show resolved Hide resolved
@seeflood seeflood enabled auto-merge (squash) October 20, 2022 05:23
auto-merge was automatically disabled October 20, 2022 05:32

Head branch was pushed to by a user without write access

Copy link
Member

@seeflood seeflood left a comment

Choose a reason for hiding this comment

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

lgtm. Thanks!

@seeflood seeflood enabled auto-merge (squash) October 20, 2022 06:22
@seeflood seeflood merged commit f70cdc6 into mosn:main Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GLCC] Implement Sequencer API with snowflake algorithm
5 participants