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

Adding optional arg to BF.INSERT to allow users to check if their bloom filter can reach the desired size #41

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

zackcam
Copy link
Contributor

@zackcam zackcam commented Jan 17, 2025

DRAFT

Need to go over error messages
Need to change how we calculate capacity

Changes

Adding ATLEASTCAPCITY as an optional arg of BF.INSERT. New bf.insert command will look like:
BF.INSERT <key> [CAPACITY capacity] [ERROR fp_error] [EXPANSION expansion] [NOCREATE] [NONSCALING] [ATLEASTCAPACITY wantedcapacity] [ITEMS item]
This argument will help a user know whether the command will fail - at the time of creation if they want to expand their filter to a certain size.
There are two new error messages associated with this:

pub const WANTED_CAPACITY_EXCEEDS_MAX_SIZE: &str =
    "ERR Wanted capacity would go beyond bloom object memory limit";
pub const WANTED_CAPACITY_FALSE_POSITIVE_INVALID: &str =
    "ERR False positive degrades too much to reach wanted capacity";

Added checks for these two error messages in test_bloom_command.py

…om filter can reach the desired size

Signed-off-by: zackcam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant