-
Notifications
You must be signed in to change notification settings - Fork 472
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
Add the support of the BF.MEXISTS and BF.CARD Command #1756
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest looks ok to me
@@ -40,6 +40,15 @@ std::string Integer(T data) { | |||
return ":" + std::to_string(data) + CRLF; | |||
} | |||
|
|||
template <typename T, std::enable_if_t<std::is_integral_v<T>, int> = 0> | |||
std::string MultiInteger(const std::vector<T> &multi_data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick question: would other Redis response can be help with MultiInteger
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Oh and @PragmaTwice and can we support a vector<bool>
version to convert vector<bool>
to 0/1 response?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure since resp3 supports boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's seems only here(BF.MExists
and BF.MAdd
) and SMIsMember
can be help with MultiInteger
. Should we give up MultiInteger
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can put it in src/commands/cmd_bloom_filter.cc
in anonymous namespace as a helper first. If you find any other user would use it, you can move it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function looks ok to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Twice <twice@apache.org>
This PR introduce the bloom BF.MEXISTS and BF.CARD command.
[1] https://redis.io/commands/bf.mexists/
[2] https://redis.io/commands/bf.card/