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

Split redis_cmd.cc to multiple files by category #1244

Merged
merged 3 commits into from
Feb 5, 2023

Conversation

PragmaTwice
Copy link
Member

@PragmaTwice PragmaTwice commented Feb 4, 2023

It closes #1138.

Current file structure in src/commands:

├── command_parser.h
├── redis_cmd_bit.cc
├── redis_cmd.cc
├── redis_cmd_cluster.cc
├── redis_cmd_error.h
├── redis_cmd_geo.cc
├── redis_cmd.h
├── redis_cmd_hash.cc
├── redis_cmd_key.cc
├── redis_cmd_list.cc
├── redis_cmd_pubsub.cc
├── redis_cmd_replication.cc
├── redis_cmd_script.cc
├── redis_cmd_server.cc
├── redis_cmd_set.cc
├── redis_cmd_sortedint.cc
├── redis_cmd_stream.cc
├── redis_cmd_string.cc
├── redis_cmd_txn.cc
├── redis_cmd_zset.cc
├── scan_util.h
└── ttl_util.h

git-hulk
git-hulk previously approved these changes Feb 4, 2023
Copy link
Member

@git-hulk git-hulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, love this pr.

@caipengbo
Copy link
Contributor

Isn't the redis_cmd_ prefix a bit redundant?

@PragmaTwice
Copy link
Member Author

Isn't the redis_cmd_ prefix a bit redundant?

I am considering cmd_*, since there are other source files in this directory.

@PragmaTwice
Copy link
Member Author

Though, the current one is acceptable for me.

@caipengbo
Copy link
Contributor

How about dropping the prefix?

@PragmaTwice
Copy link
Member Author

PragmaTwice commented Feb 4, 2023

How about dropping the prefix?

I think the prefix can make them more distinguishing than other source files (in this dir) in alphabetical order, e.g.

a  (cmd)
b
c  (cmd)
d
e  (cmd)

than

b
cmd_a
cmd_c
cmd_e
d

caipengbo
caipengbo previously approved these changes Feb 4, 2023
@PragmaTwice PragmaTwice dismissed stale reviews from caipengbo and git-hulk via cd17abf February 4, 2023 13:13
@PragmaTwice
Copy link
Member Author

PragmaTwice commented Feb 4, 2023

@caipengbo @Hulk I did some rename in cd17abf:

scan_util.h -> scan_base.h
redis_cmd.{h|cc} -> commander.{h|cc}
redis_cmd_*.{h|cc} -> cmd_*.{h|cc}
redis_cmd_error.h -> error_constants.h

Copy link
Contributor

@torwig torwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PragmaTwice Great job!

@PragmaTwice
Copy link
Member Author

Thanks all. Merging...

@PragmaTwice PragmaTwice merged commit db2860d into apache:unstable Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split commands/redis_cmd.cc to multiple source files
4 participants