zncleon commented on code in PR #1699:
URL: https://github.com/apache/kvrocks/pull/1699#discussion_r1306368769
##########
src/storage/redis_metadata.h:
##########
@@ -198,3 +200,47 @@ class StreamMetadata : public Metadata {
void Encode(std::string *dst) override;
rocksdb::Status Decode(const std::string &bytes) override;
};
+
+class BloomChainMetadata : public Metadata {
+ public:
+ /// The number of sub-filters
+ uint16_t n_filters;
+
+ /// Adding an element to a Bloom filter never fails due to the data
structure "filling up". Instead the error rate
+ /// starts to grow. To keep the error close to the one set on filter
initialisation - the bloom filter will
+ /// auto-scale, meaning when capacity is reached an additional sub-filter
will be created.
+ ///
+ /// The capacity of the new sub-filter is the capacity of the last
sub-filter multiplied by expansion.
+ ///
+ /// The default expansion value is 2.
+ ///
+ /// For non-scaling, expansion should be set to 0
+ uint16_t expansion;
+
+ /// The number of entries intended to be added to the filter. If your filter
allows scaling, the capacity of the last
+ /// sub-filter should be: base_capacity -> base_capacity * expansion ->
base_capacity * expansion^2...
+ ///
+ /// The default base_capacity value is 100.
+ uint32_t base_capacity;
+
+ /// The desired probability for false positives.
+ ///
+ /// The rate is a decimal value between 0 and 1. For example, for a desired
false positive rate of 0.1% (1 in 1000),
+ /// error_rate should be set to 0.001.
+ ///
+ /// The default error_rate value is 0.01.
+ double error_rate;
+
+ /// The total number of bytes allocated for all sub-filters.
+ uint32_t bloom_bytes;
Review Comment:
It seems 32 bits is big enough for bloom_bytes. What is size-checking for ?
--
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]