Git Product home page Git Product logo

reading-source-code-of-leveldb-1.23's Introduction

leveldb 源码阅读

1. Build && Install && Debug

leveldb 本身是一个 Key-Value 存储引擎,因此并没有提供 main 入口函数,所以需要自行添加。笔者将其放到了 debug/leveldb_debug.cc 文件中,并在 CMakeLists.txtx 中将其加入:

  leveldb_test("util/env_test.cc")
  leveldb_test("util/status_test.cc")
  leveldb_test("util/no_destructor_test.cc")
  
  if(NOT BUILD_SHARED_LIBS)
    leveldb_test("debug/leveldb_debug.cc")    # 个人可执行文件
    leveldb_test("db/autocompact_test.cc")
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug .. && cmake --build .
make && make install
gdb leveldb_debug   # 此时 leveldb_debug 就在 build 目录下,可直接进行 gdb 调试

如果使用 CLion 的话,可以直接对 leveldb_debug.cc 进行 debug,比 gdb 要更方便一些。

2. leveldb 核心流程梳理

  1. leveldb 概述与 LSM-Tree
  2. leveldb 中的常用数据结构
  3. leveldb 中的 varint 与 Key 组成
  4. leveldb Key-Value 写入流程分析
  5. leveldb 预写日志格式及其读写流程
  6. SSTable(01)—概览与 Data Block
  7. SSTable(02)—Bloom Filter 与 Meta Block
  8. SSTable(03)—SSTable 之索引
  9. SSTable(04)—Table Builder
  10. Compaction(01)—Minor Compaction
  11. leveldb 版本控制概览
  12. Compaction(02)—Major Compaction

reading-source-code-of-leveldb-1.23's People

Contributors

smartkeyerror avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.