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

153 implement a code generator to to automatically create all redis commands scaffolding arguments parsing and commands callbacks #170

Conversation

danielealbano
Copy link
Owner

This PR implements a new number of components with the goal to streamline the development of the Redis module and. at the same time, improve the compatibility and performances.

There are 3 new major components

  • A python script able to generate from a JSON file a number of headers and c files at runtime, the C files are compiled into a static library which gets injected onto the cachegrand-internal target, the headers are included as needed.
  • An automated parser able to read the data generated by the scaffolding generator and, in particular the list of arguments, their type and their tokens, and figure out if what is being received is legit and if yes figure out which fields have to be filled out of the command context (e.g., a sort of reflection but almost without overload as the most of the code is pre-generated)
  • A new hashtable single producer single consumer used to identify the commands requested by the user and to figure out the tokens of the arguments passed in the commands

This PR closes issue #153

…e related network_protocol_prometheus in module_prometheus
…rk protocols" as they are not just "protocols"
…nism to add a command end callback for the commands that aren't implemented
…context" references to use the wording module
…ed_commands_table.h in 3 separated headers with arguments, key_specs and the info_map
…, handle error messages, handle connection termination and so on)
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Aug 14, 2022

This pull request introduces 1 alert when merging 5398d36 into 8964b24 - view on LGTM.com

new alerts:

  • 1 for Wrong type of arguments to formatting function

@codecov
Copy link

codecov bot commented Aug 14, 2022

Codecov Report

Merging #170 (5521368) into main (8964b24) will increase coverage by 0.43%.
The diff coverage is 77.79%.

@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
+ Coverage   78.04%   78.47%   +0.43%     
==========================================
  Files          95      103       +8     
  Lines        6456     6580     +124     
==========================================
+ Hits         5038     5163     +125     
+ Misses       1418     1417       -1     
Impacted Files Coverage Δ
src/config_cyaml_schema.c 100.00% <ø> (ø)
...structures/hashtable/mcmp/hashtable_support_hash.h 100.00% <ø> (ø)
...uctures/hashtable/mcmp/hashtable_support_op_arch.c 93.78% <ø> (ø)
...c/module/redis/command/module_redis_command_mset.c 0.00% <0.00%> (ø)
src/network/channel/network_channel.c 92.42% <ø> (ø)
src/network/channel/network_channel_iouring.c 100.00% <ø> (ø)
src/network/channel/network_channel_tls.c 1.24% <ø> (ø)
src/network/io/network_io_common.c 94.08% <ø> (ø)
src/network/io/network_io_common_tls.c 100.00% <ø> (ø)
src/network/network.c 80.00% <0.00%> (+2.22%) ⬆️
... and 36 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@danielealbano danielealbano marked this pull request as ready for review August 15, 2022 14:22
@danielealbano danielealbano merged commit 0edd630 into main Aug 15, 2022
cachegrand automation moved this from In Progress to Completed Aug 15, 2022
@danielealbano danielealbano deleted the 153-implement-a-code-generator-to-to-automatically-create-all-redis-commands-scaffolding-arguments-parsing-and-commands-callbacks branch August 15, 2022 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
cachegrand
  
Completed
1 participant