From 10f318fb776e22d4253a4504e0bba4de69c0f2c8 Mon Sep 17 00:00:00 2001 From: zackcam Date: Mon, 2 Dec 2024 23:04:22 +0000 Subject: [PATCH] Updatign the digest changes to follow updated version of bloom Signed-off-by: zackcam --- Cargo.toml | 2 +- src/bloom/data_type.rs | 10 +--------- src/bloom/utils.rs | 4 ---- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f29cf11..d205dbc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ homepage = "https://github.com/valkey-io/valkey-bloom" valkey-module = "0.1.2" valkey-module-macros = "0" linkme = "0" -bloomfilter = { version = "3", features = ["serde"] } +bloomfilter = { version = "3.0.1", features = ["serde"] } lazy_static = "1.4.0" libc = "0.2" serde = { version = "1.0", features = ["derive"] } diff --git a/src/bloom/data_type.rs b/src/bloom/data_type.rs index 9fa86cd..294fe21 100644 --- a/src/bloom/data_type.rs +++ b/src/bloom/data_type.rs @@ -103,10 +103,6 @@ impl ValkeyDataType for BloomFilterType { } else { capacity }; - let sip_keys = [ - (FIXED_SIP_KEY_ONE_A, FIXED_SIP_KEY_ONE_B), - (FIXED_SIP_KEY_TWO_A, FIXED_SIP_KEY_TWO_B), - ]; let filter = BloomFilter::from_existing(bitmap.as_ref(), num_items as u32, capacity as u32); filters.push(filter); @@ -129,11 +125,7 @@ impl ValkeyDataType for BloomFilterType { dig.add_long_long(self.expansion.into()); dig.add_string_buffer(&self.fp_rate.to_le_bytes()); for filter in &self.filters { - dig.add_string_buffer(&filter.bloom.bitmap()); - for &(key1, key2) in &filter.sip_keys() { - dig.add_long_long(key1 as i64); - dig.add_long_long(key2 as i64); - } + dig.add_string_buffer(filter.bloom.as_slice()); dig.add_long_long(filter.num_items.into()); dig.add_long_long(filter.capacity.into()); } diff --git a/src/bloom/utils.rs b/src/bloom/utils.rs index a8a4401..3e3a00a 100644 --- a/src/bloom/utils.rs +++ b/src/bloom/utils.rs @@ -402,10 +402,6 @@ impl BloomFilter { self.bloom.set(item) } - pub fn sip_keys(&self) -> [(u64, u64); 2] { - self.bloom.sip_keys() - } - /// Create a new BloomFilter from an existing BloomFilter object (COPY command). pub fn create_copy_from(bf: &BloomFilter) -> BloomFilter { BloomFilter::from_existing(&bf.bloom.to_bytes(), bf.num_items, bf.capacity)