summaryrefslogtreecommitdiffstats
path: root/src/crimson/os/seastore/omap_manager
diff options
context:
space:
mode:
authorAran85 <z13121369189@gmail.com>2021-05-17 12:32:11 +0200
committerAran85 <z13121369189@gmail.com>2021-05-17 13:11:17 +0200
commitf426a11826f66dab262d3a4ca2aebe9f218a9b39 (patch)
tree8174d09260e2953e857209962324ee97707f47f2 /src/crimson/os/seastore/omap_manager
parentMerge PR #41128 into master (diff)
downloadceph-f426a11826f66dab262d3a4ca2aebe9f218a9b39.tar.xz
ceph-f426a11826f66dab262d3a4ca2aebe9f218a9b39.zip
crimson/seastore: add string_kv_node_layout diagrams
Signed-off-by: Zengran Zhang <zhangzengran@sangfor.com.cn>
Diffstat (limited to 'src/crimson/os/seastore/omap_manager')
-rw-r--r--src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h b/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h
index aea7487ec6e..bf8461cc3b1 100644
--- a/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h
+++ b/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h
@@ -267,6 +267,24 @@ namespace crimson::os::seastore::omap_manager {
* and related methods.
*
* Also included are helpers for doing splits and merges as for a btree.
+ *
+ * layout diagram:
+ *
+ * # <----------------------------- node range --------------------------------------------> #
+ * # #<~># free space #
+ * # <------------- left part -----------------------------> # <~# <----- right keys -----> #
+ * # # <------------ left keys --------------> #~> # #
+ * # # keys [2, n) |<~># #<~>| right keys [2, n) #
+ * # # <--- key 0 ----> | <--- key 1 ----> | # # | <- k1 -> | <-- k0 --> #
+ * # # | | # # | | #
+ * # num_ | meta # key | key | val | key | key | val | # # | key | key #
+ * # keys | depth # off | len | laddr| off | len | laddr| # # | buff | buff #
+ * # | # 0 | 0 | 0 | 1 | 1 | 1 |...#...#...| key 1 | key 0 #
+ * # | | | <- off --+----------> #
+ * # | | ^ | <- off --> #
+ * | | | ^
+ * | +----------------------------------+ |
+ * +----------------------------------------------------------------+
*/
class StringKVInnerNodeLayout {
char *buf = nullptr;
@@ -866,6 +884,27 @@ private:
};
+/**
+ * StringKVLeafNodeLayout
+ *
+ * layout diagram:
+ *
+ * # <----------------------------- node range -------------------------------------------------> #
+ * # #<~># free space #
+ * # <------------- left part ---------------------------> # <~# <----- right key-value pairs --> #
+ * # # <------------ left keys ------------> #~> # #
+ * # # keys [2, n) |<~># #<~>| right kvs [2, n) #
+ * # # <--- key 0 ---> | <--- key 1 ---> | # # | <-- kv 1 --> | <-- kv 0 --> #
+ * # # | | # # | | #
+ * # num_ | meta # key | key | val | key | key | val | # # | key | val | key | val #
+ * # keys | depth # off | len | len | off | len | len | # # | buff | buff | buff | buff #
+ * # # 0 | 0 | 0 | 1 | 1 | 1 |...#...#...| key 1 | val 1| key 0 | val 0 #
+ * # | | | <--- off ----+-------------> #
+ * # | | ^ | <--- off ---> #
+ * | | | ^
+ * | +-----------------------------------+ |
+ * +-------------------------------------------------------------------+
+ */
class StringKVLeafNodeLayout {
char *buf = nullptr;