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

Improve the implementation of SRANDMEMBER #2014

Closed
1 of 2 tasks
Tracked by #1942
PragmaTwice opened this issue Jan 14, 2024 · 7 comments · Fixed by #2032
Closed
1 of 2 tasks
Tracked by #1942

Improve the implementation of SRANDMEMBER #2014

PragmaTwice opened this issue Jan 14, 2024 · 7 comments · Fixed by #2032
Assignees
Labels
enhancement type enhancement

Comments

@PragmaTwice
Copy link
Member

Search before asking

  • I had searched in the issues and found no similar issues.

Motivation

Currently it just returns the first N members, which is not actually random.

We can improve it just like the implementation of HRANDMEMBER.
(Or if you have better ideas for random, feel free to implement them)

Solution

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@wsehjk
Copy link
Contributor

wsehjk commented Jan 19, 2024

hello could you please assign this to. Interested in this problem

@git-hulk
Copy link
Member

@wsehjk assigned, thank you!

@wsehjk
Copy link
Contributor

wsehjk commented Jan 19, 2024

Thanks, I'm newbie to this project. Does this project have any community where developers can communicate?

@git-hulk
Copy link
Member

Yes, you can join the WeChat group via the official account at the bottom of README if you're using WeChat. Or you can join the Slack channel which is also mentioned in README.

@wsehjk
Copy link
Contributor

wsehjk commented Jan 19, 2024

Hi, here is a question. If the number of member (k) is less than the count we want to select, under the context of random, does it ok to generate results less than k?

@mapleFU
Copy link
Member

mapleFU commented Jan 19, 2024

@wsehjk https://github.com/apache/kvrocks/pull/1565/files this is a example for our current impl

@wsehjk
Copy link
Contributor

wsehjk commented Jan 19, 2024

@wsehjk https://github.com/apache/kvrocks/pull/1565/files this is a example for our current impl

thanks, i will take a look at this. And i'm gonna try Reservoir Sampling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement type enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants