# redis7.0-chinese-annotated
**Repository Path**: shisan233/redis7.0-chinese-annotated
## Basic Information
- **Project Name**: redis7.0-chinese-annotated
- **Description**: Redis 7.0.5 版本——中文注释,持续更新!欢迎参与本项目!🍭🍭🍭
- **Primary Language**: C
- **License**: BSD-3-Clause
- **Default Branch**: 7.0-cn-annotated
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-03-22
- **Last Updated**: 2025-03-29
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# redis7.0 中文注释
## 项目介绍:
大家在学习一个热门开源项目的源码的时候,是不是经常会感到不解?或许你是英语不好导致的,也可能是没有注释又无法理解代码意思导致的。这是否令你常常想要放弃通过阅读源码去学习一个项目呢?从今天开始答应我不要再放弃了,好吗?因为 redis7.0 中文注释它来了!🎆🎇✨🎉
本项目旨在帮助中文区的大家能够更容易的去阅读,学习 redis 源码🍭🍭
在你学习 redis 源码的同时,如果你理解了一段源码,我们也希望你可以将你的理解做成中文注释并向本仓库发起 pull request 来和大家分享你的想法。因为让一个人来完成这么大的工程是极其困难的,所以本项目的开源目的也是想让大家一起来完善本仓库的源码注释。人多力量大!争取达成所有源码都有中文注释的目标!同时让大家都参与源码注释的修改工作,我们的注释也能够集百家之所长!🎉🎉
### 本项目很可能会成为你第一个参与的开源项目!
你只需要翻译源码里某个有较详细英文注释的函数,你就可以发起 PR 并成为 contributor!更好的是你还能带上你自己的理解。除此之外还有更简单的如:修改错别字、修改格式错误或者修改意思错误的注释,你也可以成为 contributor。该项目目前仍处于初期,还有很多未完成注释的源码,希望大家能够一起合力把注释填满整个项目!✨✨
本项目灵感来源于《Redis设计与实现》作者黄健宏的redis3.0注释仓库:https://github.com/huangz1990/redis-3.0-annotated
redis 仓库链接:https://github.com/redis/redis
点击右上角的 star⭐,可以持续关注我们仓库接下来的更新哦!🍭🍭
## 项目进度:
完成度标准介绍:
| 文件 | 作用 | 完成度 | | - | :-: | - | | [t_string.c ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/t_string.c) | 定义了 string 字符串类型以及相关命令,例如 SET/GET | 完成 | | [t_hash.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/t_hash.c) | 定义了 hash 哈希类型以及相关命令,例如 HSET/HGET | 完成 | | [t_list.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/t_list.c) | 定义了 list 列表类型以及相关命令,例如 LPUSH/RPOP | 完成 | | [t_set.c ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/t_set.c ) | 定义了 set 集合类型以及相关命令,例如 SADD/SMEMBERS | 完成 | | [t_zset.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/t_zset.c) | 定义了 zset 有序类型(包含 skiplist 跳表的实现)以及相关命令,例如 ZADD/ZRANGE | 完成 | | [sds.h](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/sds.h) | SDS(简单动态字符串)数据结构的相关声明,用于字符串底层数据结构实现 | 完成 | | [sds.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/sds.c) | SDS(简单动态字符串)数据结构的具体实现 | 完成 | | [quicklist.h](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/quicklist.h) | 快速列表数据结构的相关声明,3.2 版本后结合双端链表和压缩列表用于列表键底层数据结构实现,7.0 版本后结合双端列表和紧凑列表用于列表键底层数据结构实现 | 完成 | | [quicklist.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/quicklist.c) | 快速列表数据结构的具体实现 | 低于一半 | | [adlist.h](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/adlist.h) | 双端链表数据结构的相关声明,3.2 版本之前作为列表键的底层数据结构实现,也用于其它需要链表的场景,例如保存连接的客户端、慢查询条目等等 | 完成 | | [adlist.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/adlist.c) | 双端链表数据结构的具体实现 | 完成 | | [cli_common.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/cli_common.c) | 命令行接口-通用接口的具体实现 | 完成 | | [intset.h](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/intset.h) | 整数集合数据结构的相关声明,作为集合键的底层实现之一 | 完成 | | [intset.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/intset.c) | 整数集合数据结构的具体实现 | 完成 | | [dict.h](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/dict.h) | 字典数据结构的相关声明,用于 redis 中 hashtable(哈希表)的底层实现 | 完成 | | [dict.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/dict.c) | 定义了 dict 集合类型相关数据结构 | 过半 | | [zmalloc.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/zmalloc.c) | redis 中内存管理的具体实现 | 低于一半 | | [ziplist.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/ziplist.c) | ziplist 压缩列表的实现,7.0 版本后被 listpack 紧凑列表替换了 | 低于一半 | | [sentinel.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/sentinel.c) | sentinel 哨兵机制的具体实现 | 低于一半 | | [rdb.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/rdb.c) | RDB 持久化功能的具体实现 | 低于一半 | | [replication.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/replication.c) | 主从复制的具体实现 | 低于一半 | | [object.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/object.c) | Redis 的对象系统实现 | 低于一半 | | [util.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/util.c) | Redis 工具函数 | 低于一半 | | [blocked.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/blocked.c) | Redis 对 BLPOP 和 WAIT 等阻塞操作的通用支持 | 低于一半 | | [rio.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/rio.c) | 四种 redis IO 类型操作的实现 | 过半 | | [cluster.h](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/cluster.h) | redis 集群数据结构定义 | 完成 | | [cluster.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/cluster.c) | redis 集群实现 | 低于一半 | | [bio.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/bio.c) | redis 后台 IO 线程模型 | 完成 | | [lazyfree.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/lazyfree.c) | redis 惰性删除功能 | 完成 | | [ae.h](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/ae.h) | redis 事件循环器结构定义 | 完成 | | [ae.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/ae.c) | redis 事件循环器功能 | 完成 | | [multi.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/multi.c) | redis 事务实现 | 完成 | | [redis-check-rdb.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/redis-check-rdb.c) | Redis RDB 检查工具 | 完成 | | [redis-check-aof.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/redis-check-aof.c) | Redis AOF 检查工具 | 低于一半 | | [evict.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/evict.c) | 四种 redis 内存淘汰算法 | 完成 | | [aof.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/aof.c) | redis AOF 功能 | 过半 | | [replication.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/replication.c) | Redis 主从复制 | 低于一半 | | [listpack.h](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/listpack.h) | listpack 紧凑列表定义 | 完成 | | [listpack.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/listpack.c) | listpack 紧凑列表实现 | 低于一半 | | [networking.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/networking.c) | Redis 客户端、主、副本 I/O 相关 | 低于一半 | | [hyperloglog.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/hyperloglog.c) | Redis HyperLogLog 实现以及相关命令 | 过半 | | [geo.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/geo.c) | geo 功能 | 完成 | | [geohash.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/geohash.c) | geo 功能 | 完成 | | [geohash_helper.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/geohash_helper.c) | geo 功能 | 完成 | | [rax.h](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/rax.h) | Redis 压缩前缀树定义 | 完成 | | [rax.c](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/rax.c) | Redis 压缩前缀树实现 | 过半 | | [localtime.c ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/localtime.c) | 实现一个无锁的本地时间转换函数 | 完成 | | [mt19937-64.h ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/mt19937-64.h) | 基于64位梅森旋转算法生成高质量伪随机数获取接口声明 | 完成 | | [mt19937-64.c ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/mt19937-64.c) | 通过64位梅森旋转算法生成高质量伪随机数实现 | 完成 | | [crc16.c ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/crc16.c) | 生成 CRC16(2 字节)校验码实现 | 完成 | | [crc16_slottable.h ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/crc16_slottable.h) | crc16 校验码到 Redis 集群槽位(slot)的映射关系 | 完成 | | [crc64.h ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/crc64.h) | 生成 CRC64(8 字节)校验码,暴露接口声明 | 完成 | | [crc64.c ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/crc64.c) | 生成 CRC64(8 字节)校验码的相关实现,5.0 版本时仍是传统的逐字节查表法(此时只有该文件,实现和 CRC16 一致),6.0 后引入 CRCSpeed 库,基于 slicing-by-8 技术 | 完成 | | [crcspeed.h ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/crcspeed.h) | 基于 slicing-by-8 技术,加速计算 CRC 值,相关获取接口声明 | 完成 | | [crcspeed.c ](https://github.com/CN-annotation-team/redis7.0-chinese-annotated/blob/7.0-cn-annotated/src/crcspeed.c) | 基于 slicing-by-8 技术,及动态生成查表,相关接口实现 | 完成 |
尚未有中文注释的文件不会出现在表格中。