You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by ti...@apache.org on 2026/07/25 13:45:32 UTC

(datasketches-rust) 02/13: refactor(theta): call full hash seeds seed

This is an automated email from the ASF dual-hosted git repository.

tisonkun pushed a commit to branch codex/naming-drift-audit
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git

commit 643a358f9a1fa94f0dc49923b4aaec740dffebf1
Author: tison <wa...@gmail.com>
AuthorDate: Sat Jul 25 21:40:08 2026 +0800

    refactor(theta): call full hash seeds seed
---
 datasketches/src/thetacommon/hash_table.rs   | 20 ++++++++++----------
 datasketches/src/thetacommon/intersection.rs |  6 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/datasketches/src/thetacommon/hash_table.rs b/datasketches/src/thetacommon/hash_table.rs
index e17a453..c9f2e45 100644
--- a/datasketches/src/thetacommon/hash_table.rs
+++ b/datasketches/src/thetacommon/hash_table.rs
@@ -54,7 +54,7 @@ pub struct RawHashTable<E> {
     lg_max_size: u8,
     resize_factor: ResizeFactor,
     sampling_probability: f32,
-    hash_seed: u64,
+    seed: u64,
 
     // Logical emptiness of the source set.
     //
@@ -81,7 +81,7 @@ where
         lg_nom_size: u8,
         resize_factor: ResizeFactor,
         sampling_probability: f32,
-        hash_seed: u64,
+        seed: u64,
     ) -> Self {
         let lg_max_size = lg_nom_size + 1;
         let lg_cur_size = starting_sub_multiple(lg_max_size, MIN_LG_K, resize_factor.lg_value());
@@ -91,7 +91,7 @@ where
             resize_factor,
             sampling_probability,
             starting_theta_from_sampling_probability(sampling_probability),
-            hash_seed,
+            seed,
             true,
         )
     }
@@ -107,7 +107,7 @@ where
         resize_factor: ResizeFactor,
         sampling_probability: f32,
         theta: u64,
-        hash_seed: u64,
+        seed: u64,
         is_empty: bool,
     ) -> Self {
         let lg_max_size = lg_nom_size + 1;
@@ -123,7 +123,7 @@ where
             lg_max_size,
             resize_factor,
             sampling_probability,
-            hash_seed,
+            seed,
             is_empty,
             theta,
             entries,
@@ -133,7 +133,7 @@ where
 
     /// Hash a value with the table seed and return the hash.
     pub fn hash<T: Hash>(&self, value: T) -> u64 {
-        let mut hasher = MurmurHash3X64128::with_seed(self.hash_seed);
+        let mut hasher = MurmurHash3X64128::with_seed(self.seed);
         value.hash(&mut hasher);
         let (h1, _) = hasher.finish128();
         h1 >> 1 // To make it compatible with Java version
@@ -306,7 +306,7 @@ where
 
     /// Get the hash of the seed that was used to hash the input.
     pub fn seed_hash(&self) -> u16 {
-        compute_seed_hash(self.hash_seed)
+        compute_seed_hash(self.seed)
     }
 
     /// Set empty flag.
@@ -314,9 +314,9 @@ where
         self.is_empty = is_empty;
     }
 
-    /// Get the hash seed used by this table.
-    pub fn hash_seed(&self) -> u64 {
-        self.hash_seed
+    /// Get the seed used by this table.
+    pub fn seed(&self) -> u64 {
+        self.seed
     }
 
     /// Sets theta value.
diff --git a/datasketches/src/thetacommon/intersection.rs b/datasketches/src/thetacommon/intersection.rs
index c2bb2be..59af528 100644
--- a/datasketches/src/thetacommon/intersection.rs
+++ b/datasketches/src/thetacommon/intersection.rs
@@ -81,7 +81,7 @@ where
                 ResizeFactor::X1,
                 1.0,
                 table.theta(),
-                table.hash_seed(),
+                table.seed(),
                 table.is_empty(),
             )
         };
@@ -134,7 +134,7 @@ where
                 ResizeFactor::X1,
                 1.0,
                 self.table.theta(),
-                self.table.hash_seed(),
+                self.table.seed(),
                 self.table.is_empty(),
             );
             for entry in sketch.iter() {
@@ -205,7 +205,7 @@ where
                     ResizeFactor::X1,
                     1.0,
                     self.table.theta(),
-                    self.table.hash_seed(),
+                    self.table.seed(),
                     self.table.is_empty(),
                 );
                 for entry in matched_entries {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org