Skip to content

Introduce pelikan_bloomcache#468

Open
swlynch99 wants to merge 12 commits intotwitter:masterfrom
swlynch99:http
Open

Introduce pelikan_bloomcache#468
swlynch99 wants to merge 12 commits intotwitter:masterfrom
swlynch99:http

Conversation

@swlynch99
Copy link
Contributor

@swlynch99 swlynch99 commented Sep 30, 2022

This is code-complete and lightly tested. I haven't tested this beyond some basic smoke tests but ultimately the code is pretty simple.

@swlynch99 swlynch99 mentioned this pull request Oct 3, 2022
@swlynch99 swlynch99 requested a review from brayniac October 11, 2022 22:46
@swlynch99 swlynch99 marked this pull request as ready for review October 11, 2022 22:52

/// 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.

@@ -0,0 +1,42 @@
// Copyright 2021 Twitter, Inc.
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo?

seg = { path = "../storage/seg" } No newline at end of file
protocol-http = { path = "../protocol/http" }
seg = { path = "../storage/seg" }
bloom = { path = "../storage/bloom" } No newline at end of file
Copy link
Contributor

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.
Copy link
Contributor

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::{
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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);
Copy link
Contributor

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.

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.

3 participants