Closed longfar-ncy closed 1 month ago
[!IMPORTANT]
Review skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
改动集中在数据库配置和RAID组件的简化和重构。数据库实例数量从16减少到1,RocksDB每个实例从3减到1。同时,行程控制模块从PRAFT过渡到praft实例,实现了更灵活的功能调用和流畅的控制逻辑。
文件 | 变更摘要 |
---|---|
pikiwidb.conf | 数据库数量从16个减少到1个,RocksDB实例数量从3个减少到1个,RAFT设定从no 改为yes 。 |
src/base_cmd.cc | 引入store.h ,替换对PRAFT 的引用为praft ,更新条件检查。 |
src/client.cc | 更新函数handlePacket 、OnConnect 和isClusterCmdTarget 逻辑,使用praft 实例。 |
src/cmd_admin.cc | 在InfoCmd 类中,初始化praft_ 并用praft_ 替代PRAFT 。 |
src/cmd_admin.h | 在InfoCmd 类中新增PRaft* praft_ 私有成员。 |
src/cmd_raft.cc | 使用praft_ 实例替换PRAFT ,并在DoCmd 方法中添加assert(praft_) 。 |
src/config.h | 更改PConfig 类中databases 和db_instance_num 的初始值分别为1。 |
src/db.cc | 更新 lambda 表达式逻辑,使用*praft_ 代替PRAFT 。 |
src/db.h | 更多引入及引用替代,新增GetPRaft() 方法,使用std::make_unique<PRaft>() 初始化praft_ 。 |
src/pikiwidb.cc | 删除了Stop() 函数中对pikiwidb::PRAFT 的关停调用。 |
src/praft/praft.cc | 重构PRaft::Init 方法,移除brpc::Server 成员,更新类方法调用。 |
src/praft/praft.h | 更新ClusterCmdContext 构造函数,移除brpc::Server 成员,简化IsInitialized 方法。 |
src/store.cc | 添加RPC服务初始化逻辑并成功启动。 |
src/store.h | 引入更多新头文件,添加GetRpcServer() 和GetEndPoint() 方法,新增成员变量endpoint_ 和rpc_server_ 。 |
改变如风卷浪花新,数据库简约更清新。
RAID重构流畅妙,praft支撑稳如金。
功能实现灵巧流,跃动数据心欢欣。
代码优化如画卷,策略调整喜成锦。
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
新功能
性能优化
代码重构