chore: serialize SBF (#2846)

* chore: serialize SBF

SAVE/LOAD supports SBF now. Also fixes MallocUsed for SBF.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-04-09 09:57:24 +03:00 committed by GitHub
parent b1e688b33f
commit 57d567639c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 107 additions and 4 deletions

View file

@ -534,4 +534,12 @@ TEST_F(RdbTest, RedisJson) {
"{\"company\":\"DragonflyDB\",\"product\":\"Dragonfly\",\"website\":\"https://"
"dragondlydb.io\",\"years-active\":[2021,2022,2023,2024,\"and more!\"]}");
}
TEST_F(RdbTest, SBF) {
EXPECT_THAT(Run({"BF.ADD", "k", "1"}), IntArg(1));
Run({"debug", "reload"});
EXPECT_EQ(Run({"type", "k"}), "MBbloom--");
EXPECT_THAT(Run({"BF.EXISTS", "k", "1"}), IntArg(1));
}
} // namespace dfly