From 56c38d8c223f5a538889986984c6997e9d170d58 Mon Sep 17 00:00:00 2001 From: Zhenchi Date: Fri, 20 Dec 2024 07:58:27 +0000 Subject: [PATCH] fix conflict Signed-off-by: Zhenchi --- src/index/src/bloom_filter/reader.rs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/index/src/bloom_filter/reader.rs b/src/index/src/bloom_filter/reader.rs index 246d77ca3de9..e68baf990976 100644 --- a/src/index/src/bloom_filter/reader.rs +++ b/src/index/src/bloom_filter/reader.rs @@ -179,18 +179,36 @@ impl BloomFilterMetaReader { #[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 { 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();