# leveldb **Repository Path**: hsyj/leveldb ## Basic Information - **Project Name**: leveldb - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-05-13 - **Last Updated**: 2022-05-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 开发计划 ```text 从磁盘文件sstable结构出发 封装mmap,filechannel等文件调用 最小单元Block Entry结构 优化Block Entry长度字段占用字节数 使用前缀压缩优化key占用字节数 使用分组技术实现二分搜索Block Entry 写入Entry,二分搜索Entry 测试写入Entry,二分搜索Entry 写入Block Trailer记录每个block的压缩类型和crc32 至此单个Data Block完成 一个文件有多个Data Block,需要为它建立索引Index Block 在多个Data Block中写入Entry 在多个Data Block中搜索Entry 测试写入Entry,二分搜索Entry 编写Filter Data Block实现扩展功能如布隆过滤器 为Filter Data Block建立索引 MetaIndexBlock 为Index Block和MetaIndexBlock建立Footer 至此sstable的sst文件完成 内存结构skipListmemtable,immu memtable wal log ,写日志,写操作时只写一次内存和一次顺序写日志 compaction,从immu memtable合并到L0,从L0合并到L1。。。。 version,多版本控制,VersionEdit,VersionSet 添加manifest文件,current文件 为读操作加入cache,加快速度 ``` # leveldb [SST文件格式](https://fy248xxahm.feishu.cn/docs/doccnvbf4qj6wFeGTZnFD1C7JLy) ![img.png](img/img.png) # 参考资料 https://o444bvn7jh.feishu.cn/docs/doccnu908W2H8EAy2b462KdH0ah https://o444bvn7jh.feishu.cn/file/boxcn1XBTHKMyKTxHhhxT63NeGc https://o444bvn7jh.feishu.cn/drive/folder/fldcnkBD1Ulbr8z03KMw9lUcaTc https://blog.csdn.net/anderscloud/article/details/7182165 https://www.cnblogs.com/cobbliu/p/6194072.html https://github.com/dain/leveldb.git