OpenAtomFoundation / pikiwidb

a high-performance, large-capacity, multi-tenant, data-persistent, strong data consistency based on raft, Redis-compatible elastic KV data storage system based on RocksDB
BSD 3-Clause "New" or "Revised" License
201 stars 63 forks source link

feat: Refactor config #255

Closed dingxiaoshuai123 closed 6 months ago

dingxiaoshuai123 commented 7 months ago

1) 支持三种类型的配置信息 : string (包括 multi string) 、Number(int, double等等类型)和 Bool 类型.

2) 除了 string 外的类型使用 atomic 原子读写. 对于 string 类型封装了 AtomicString.

3) 需要通过 config get 去读取或者 config set 去设置的成员会添加到 map 中. config set/get 会对 map 进行通用操作,所以新增 config 或者删除 config 不需要更改 config set/get 的实现, 只需要在 Config 类中添加成员, 并将其加入到 map 中即可.

4) 暂时使用了 RocksDB 的 Status 作为返回值, 但是返回的message有点冗余, 如果自己能够实现一个类似于 RocksDB::Status 的话, 会方便很多

5) 在配置文件中添加了 RocksDB 参数并修改了传入 RocksDB Options 的逻辑.

image

longfar-ncy commented 7 months ago

另外就是好奇一下PikiwiDB有在非初始化阶段更改配置的需求嘛?

Issues-translate-bot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically.


Also, I am curious about whether PikiwiDB needs to change the configuration during the non-initialization stage?

dingxiaoshuai123 commented 7 months ago

另外就是好奇一下PikiwiDB有在非初始化阶段更改配置的需求嘛?

运行时修改吗?有的

Issues-translate-bot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically.


Also, I am curious about whether PikiwiDB needs to change the configuration during the non-initialization stage?

Is it modified during runtime? Yes