nagisa-kunhah commented on code in PR #3481:
URL: https://github.com/apache/kvrocks/pull/3481#discussion_r3266028468


##########
src/storage/redis_metadata.h:
##########
@@ -334,6 +335,50 @@ class BloomChainMetadata : public Metadata {
   bool IsScaling() const { return expansion != 0; };
 };
 
+constexpr uint32_t kCuckooFilterDefaultPageSize = 2048;
+
+class CuckooChainMetadata : public Metadata {
+ public:
+  /// The number of sub-filters in the chain
+  uint16_t n_filters;
+
+  /// Expansion factor for new filters
+  /// When a filter is full, a new one is created with capacity = 
base_capacity * expansion^n
+  uint16_t expansion;
+
+  /// The capacity of the first filter
+  uint64_t base_capacity;

Review Comment:
   `base_capacity` represents the capacity of the first sub-filter. Later 
sub-filter capacities are derived from it using `base_capacity * expansion^i`.
   Since both `base_capacity` and `expansion` are user-provided during 
`CF.RESERVE` and may differ across filters, we need to store `base_capacity` in 
each filter’s metadata.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to