Replies: 1 comment
-
How about just hide the mutable inside the BloomFilter(without adding a Also cc @PragmaTwice |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the underlying buffer data structure of the BloomFilter is
nonstd::span<char>
[1], but in some scenes, it maybe not suitable.For example, the PinnableSlice
.data()
return theconst char*
, which can't fit the BlockSplitBloomFilter for the data type isspan<char>
and we needspan<const char>
. I have 2 solutions to temporarily resolve it:span<T>
and specializespan<char>
andspan<const char>
const_cast<char *>
to converse the PinnableSlice.data()
returnBut I think the two way is not graceful and reasonable.
If we should introduce a widely suitable data structure[2], which ont only contains the pointer to the data but also contains the
is_mutable
,is_owned
and other member to fit in more scenes.[1] https://github.com/apache/kvrocks/blob/unstable/src/types/bloom_filter.h
[2] https://github.com/apache/arrow/blob/main/cpp/src/arrow/buffer.h
Beta Was this translation helpful? Give feedback.
All reactions