Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Refactor config #255

Merged
merged 23 commits into from
Apr 19, 2024
Merged

Conversation

dingxiaoshuai123
Copy link
Collaborator

@dingxiaoshuai123 dingxiaoshuai123 commented Apr 2, 2024

  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

@dingxiaoshuai123 dingxiaoshuai123 marked this pull request as draft April 2, 2024 10:36
@github-actions github-actions bot added ✏️ Feature New feature or request 🧹 Updates This will not be worked on labels Apr 2, 2024
src/config.h Outdated Show resolved Hide resolved
src/config.h Show resolved Hide resolved
src/config.h Outdated Show resolved Hide resolved
src/base_cmd.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.h Outdated Show resolved Hide resolved
src/config.h Outdated Show resolved Hide resolved
src/config.h Outdated Show resolved Hide resolved
src/config.h Outdated Show resolved Hide resolved
src/config.h Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.h Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
@longfar-ncy
Copy link
Collaborator

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

@Issues-translate-bot
Copy link

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
Copy link
Collaborator Author

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

运行时修改吗?有的

@Issues-translate-bot
Copy link

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

@dingxiaoshuai123 dingxiaoshuai123 marked this pull request as ready for review April 4, 2024 08:02
@dingxiaoshuai123 dingxiaoshuai123 force-pushed the config branch 2 times, most recently from edc3be3 to 040e10b Compare April 18, 2024 07:40
@dingxiaoshuai123 dingxiaoshuai123 force-pushed the config branch 2 times, most recently from 3408e76 to 8b69e5c Compare April 18, 2024 09:58
src/config.h Outdated Show resolved Hide resolved
src/config.h Outdated Show resolved Hide resolved
AlexStocks
AlexStocks previously approved these changes Apr 18, 2024
src/cmd_admin.cc Outdated Show resolved Hide resolved
longfar-ncy
longfar-ncy previously approved these changes Apr 19, 2024
@AlexStocks AlexStocks merged commit 7e2d2fd into OpenAtomFoundation:unstable Apr 19, 2024
5 checks passed
@dingxiaoshuai123 dingxiaoshuai123 deleted the config branch April 22, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Feature New feature or request 🧹 Updates This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants