[RocksDB剖析系列]|[RocksDB剖析系列] BlockBasedTableBuilder源码解读

参考:

  • https://www.jianshu.com/p/9b5...
  • https://zhuanlan.zhihu.com/p/...
SST File Format 之前在LSM-Tree部分有提过,但当时了解的比较浅
[data block 1] [data block 2] ... [data block N] [meta block 1: filter block] [meta block 2: index block] [meta block 3: compression dictionary block] [meta block 4: range deletion block] [meta block 5: stats block] ... [meta block K: future extended block](More meta blocks may be added in the future) [metaindex block] [Footer](fixed size; starts at file_size - sizeof(Footer))

与BlockBasedTableBuilder相关的类有以下几个
  • BlockBasedTable, 该类封装了用于读取磁盘BlockBasedTable类型的SST表的逻辑。
  • BlockBasedTableBuilder, 该类用于在磁盘上构建一个BlockBasedTable类型的SST表。
  • BlockBasedTableFactory, 该类是BlockBasedTable工厂方法的实现,用于创建BlockBasedTable/BlockBasedTableBuilder。
Write Block的顺序: 【[RocksDB剖析系列]|[RocksDB剖析系列] BlockBasedTableBuilder源码解读】Write meta blocks, metaindex block and footer in the following order.
  1. [meta block: filter]
  2. [meta block: index]
  3. [meta block: compression dictionary]
  4. [meta block: range deletion tombstone]
  5. [meta block: properties]
  6. [metaindex block]
  7. Footer

    推荐阅读