-
Notifications
You must be signed in to change notification settings - Fork 5
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
115-offloadable-bloom-filter #121
Conversation
This reverts commit f4fa7e2.
@vovac12 please, fix merge conflicts |
…:qoollo/pearl into 115-offloadable-bloom-filter
src/blob/index/bptree/core.rs
Outdated
if i >= self.header.meta_size as u64 { | ||
return Err(anyhow::anyhow!("read meta out of range")); | ||
} | ||
let mut buf = vec![0; 1]; |
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 use just an array here
src/blob/index/core.rs
Outdated
if !self.range_filter.contains(key) { | ||
FilterResult::NotContains | ||
} else if self.params.bloom_is_on && !self.bloom_filter.contains(key) { | ||
} else if self.params.bloom_is_on | ||
&& matches!(self.check_bloom_key(key).await, Ok(Some(false))) |
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 works fine. But we need to investigate errors somehow. And errors would be just dropped here. Maybe it makes sense to return Result<FilterResult>
here
src/blob/index/core.rs
Outdated
if !self.range_filter.contains(key) { | ||
FilterResult::NotContains | ||
} else if self.params.bloom_is_on | ||
&& self.bloom_filter.contains_in_memory(key) == Some(false) |
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 squash this condition with previous
src/storage/core.rs
Outdated
/// Returns memory allocated for bloom filter buffer | ||
pub async fn filter_memory_allocated(&self) -> usize { | ||
let safe = self.inner.safe.read().await; | ||
let active = if let Some(ablob) = safe.active_blob.as_ref() { |
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 would be shorter with map_or()
…l into 115-offloadable-bloom-filter
Closes #115