-
Notifications
You must be signed in to change notification settings - Fork 174
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
Introduce pelikan_bloomcache #468
base: master
Are you sure you want to change the base?
Conversation
with '#' will be ignored, and an empty message aborts the commit.
|
||
/// The number of hash functions that are evaluated for each value inserted.F | ||
#[serde(default = "hashes")] | ||
pub hashes: usize, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,42 @@ | |||
// Copyright 2021 Twitter, Inc. |
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.
2022
#[serde(default = "size")] | ||
pub size: usize, | ||
|
||
/// The number of hash functions that are evaluated for each value inserted.F |
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.
Typo?
protocol-http = { path = "../protocol/http" } | ||
seg = { path = "../storage/seg" } | ||
bloom = { path = "../storage/bloom" } |
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.
Would prefer alphabetical ordering
@@ -0,0 +1,54 @@ | |||
// Copyright 2021 Twitter, Inc. |
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.
2022
// http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
use protocol_common::Execute; | ||
use protocol_http::{ |
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.
I'd rather not use this style here and would prefer two use statements.
@@ -0,0 +1,34 @@ | |||
// Copyright 2021 Twitter, Inc. |
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.
2022
impl Bloom { | ||
/// Create a bloom filter storage based on the config. | ||
pub fn new<T: BloomConfig>(config: &T) -> Result<Self, std::io::Error> { | ||
// TODO: Validate the config here and return an error. |
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.
Generally we've been putting names on the TODOs - eg: TODO(bmartin):
@@ -0,0 +1,51 @@ | |||
// Copyright 2021 Twitter, Inc. |
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.
2022
@@ -0,0 +1,96 @@ | |||
// Copyright 2021 Twitter, Inc. |
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.
2022
fn main() { | ||
// custom panic hook to terminate whole process after unwinding | ||
std::panic::set_hook(Box::new(|s| { | ||
error!("{}", s); |
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.
Change this to eprintln please. We don't guarantee the log is flushed before terminating and having the error message lost is not a great experience.
This is code-complete and lightly tested. I haven't tested this beyond some basic smoke tests but ultimately the code is pretty simple.