Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Zhenchi <[email protected]>
  • Loading branch information
zhongzc committed Dec 20, 2024
1 parent 31b227a commit 56c38d8
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/index/src/bloom_filter/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,36 @@ impl<R: RangeReader> BloomFilterMetaReader<R> {

#[cfg(test)]
mod tests {
use std::sync::atomic::AtomicUsize;
use std::sync::Arc;

use futures::io::Cursor;

use super::*;
use crate::bloom_filter::creator::BloomFilterCreator;
use crate::external_provider::MockExternalTempFileProvider;

async fn mock_bloom_filter_bytes() -> Vec<u8> {
let mut writer = Cursor::new(vec![]);
let mut creator = BloomFilterCreator::new(2);
let mut creator = BloomFilterCreator::new(
2,
Box::new(MockExternalTempFileProvider::new()),
Arc::new(AtomicUsize::new(0)),
None,
);

creator.push_row_elems(vec![b"a".to_vec(), b"b".to_vec()]);
creator.push_row_elems(vec![b"c".to_vec(), b"d".to_vec()]);
creator.push_row_elems(vec![b"e".to_vec(), b"f".to_vec()]);
creator
.push_row_elems(vec![b"a".to_vec(), b"b".to_vec()])
.await
.unwrap();
creator
.push_row_elems(vec![b"c".to_vec(), b"d".to_vec()])
.await
.unwrap();
creator
.push_row_elems(vec![b"e".to_vec(), b"f".to_vec()])
.await
.unwrap();

creator.finish(&mut writer).await.unwrap();

Expand Down

0 comments on commit 56c38d8

Please sign in to comment.