From 892472996fd260e399c1b43667ff2d9e18d1ea46 Mon Sep 17 00:00:00 2001 From: mwish Date: Mon, 22 Jul 2024 22:34:32 +0800 Subject: [PATCH 1/3] Add document for bitmap with empty segment and smaller than 1KiB segment --- community/data-structure-on-rocksdb.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/community/data-structure-on-rocksdb.md b/community/data-structure-on-rocksdb.md index 7e0eaf3a..f7347c0a 100644 --- a/community/data-structure-on-rocksdb.md +++ b/community/data-structure-on-rocksdb.md @@ -212,6 +212,8 @@ key|version|index => | fragment | When the user requests to get it of position P, Kvrocks would first fetch the metadata with bitmap's key and calculate the index of the fragment with bit position, then fetch the bitmap fragment with composed key and find the bit in fragment offset. For example, `getbit bitmap 8193`, the fragment index is `1` (8193/8192) and subkey is `bitmap|1|1024` (when the version is 1, and fragment index is `1`, kvrocks will use `1 * 1024` as the index key), then fetch the subkey from RocksDB and check if the bit of offset `1`(8193%8192) is set or not. +An non exists segment means all bits are 0 in this segment. The bitmap design is very efficient when the bitmap is sparse. Besides, an segment could be less than 1KiB, and the "padding" bits are always regarded as 0. + ## SortedInt SortedInt is a set with members being type int and sorted in ascending order: From e4509a615836757b0ed927157ecc655358c05ac3 Mon Sep 17 00:00:00 2001 From: mwish Date: Mon, 22 Jul 2024 23:38:06 +0800 Subject: [PATCH 2/3] Update community/data-structure-on-rocksdb.md --- community/data-structure-on-rocksdb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community/data-structure-on-rocksdb.md b/community/data-structure-on-rocksdb.md index f7347c0a..2ba27b3e 100644 --- a/community/data-structure-on-rocksdb.md +++ b/community/data-structure-on-rocksdb.md @@ -212,7 +212,7 @@ key|version|index => | fragment | When the user requests to get it of position P, Kvrocks would first fetch the metadata with bitmap's key and calculate the index of the fragment with bit position, then fetch the bitmap fragment with composed key and find the bit in fragment offset. For example, `getbit bitmap 8193`, the fragment index is `1` (8193/8192) and subkey is `bitmap|1|1024` (when the version is 1, and fragment index is `1`, kvrocks will use `1 * 1024` as the index key), then fetch the subkey from RocksDB and check if the bit of offset `1`(8193%8192) is set or not. -An non exists segment means all bits are 0 in this segment. The bitmap design is very efficient when the bitmap is sparse. Besides, an segment could be less than 1KiB, and the "padding" bits are always regarded as 0. +An non exists segment means all bits are 0 in this segment. The bitmap design is very efficient when the bitmap is sparse. Besides, a segment could be less than 1KiB, and the "padding" bits are always regarded as 0. ## SortedInt From 3aaeb1951e5bb02b47c277eeabcb97d736515322 Mon Sep 17 00:00:00 2001 From: mwish Date: Tue, 23 Jul 2024 19:18:33 +0800 Subject: [PATCH 3/3] Update community/data-structure-on-rocksdb.md Co-authored-by: Twice --- community/data-structure-on-rocksdb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community/data-structure-on-rocksdb.md b/community/data-structure-on-rocksdb.md index 2ba27b3e..1cf54a4a 100644 --- a/community/data-structure-on-rocksdb.md +++ b/community/data-structure-on-rocksdb.md @@ -212,7 +212,7 @@ key|version|index => | fragment | When the user requests to get it of position P, Kvrocks would first fetch the metadata with bitmap's key and calculate the index of the fragment with bit position, then fetch the bitmap fragment with composed key and find the bit in fragment offset. For example, `getbit bitmap 8193`, the fragment index is `1` (8193/8192) and subkey is `bitmap|1|1024` (when the version is 1, and fragment index is `1`, kvrocks will use `1 * 1024` as the index key), then fetch the subkey from RocksDB and check if the bit of offset `1`(8193%8192) is set or not. -An non exists segment means all bits are 0 in this segment. The bitmap design is very efficient when the bitmap is sparse. Besides, a segment could be less than 1KiB, and the "padding" bits are always regarded as 0. +A nonexistent segment means all bits are 0 in this segment. The bitmap design is very efficient when the bitmap is sparse. Besides, a segment could be less than 1KiB, and the "padding" bits are always regarded as 0. ## SortedInt