Skip to content

Commit

Permalink
Updatign the digest changes to follow updated version of bloom
Browse files Browse the repository at this point in the history
Signed-off-by: zackcam <[email protected]>
  • Loading branch information
zackcam committed Dec 2, 2024
1 parent 669fd9f commit 10f318f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
10 changes: 1 addition & 9 deletions src/bloom/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
}
Expand Down
4 changes: 0 additions & 4 deletions src/bloom/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 10f318f

Please sign in to comment.