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

Implement randomkey command #202

Merged
merged 8 commits into from
Aug 29, 2022
Merged

Conversation

danielealbano
Copy link
Owner

This PR implements the RANDOMKEY command.

It refactors the hashtable op get key function to return a copy of the key from the hashtable and to ensure that the copy is actually valid implementing a 2-phase verification.

The PR also includes the tests for the new command and a minor improvement to the DBSIZE command

@danielealbano danielealbano added the enhancement New feature or request label Aug 29, 2022
@danielealbano danielealbano added this to the v0.2 milestone Aug 29, 2022
@danielealbano danielealbano self-assigned this Aug 29, 2022
@codecov
Copy link

codecov bot commented Aug 29, 2022

Codecov Report

Base: 80.84% // Head: 80.87% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (66778f3) compared to base (93246b1).
Patch coverage: 86.36% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #202      +/-   ##
==========================================
+ Coverage   80.84%   80.87%   +0.04%     
==========================================
  Files         129      131       +2     
  Lines        7760     7801      +41     
==========================================
+ Hits         6273     6309      +36     
- Misses       1487     1492       +5     
Impacted Files Coverage Δ
...ta_structures/hashtable/mcmp/hashtable_op_delete.c 100.00% <ø> (ø)
...uctures/hashtable/mcmp/hashtable_support_op_arch.c 93.87% <ø> (ø)
...a_structures/hashtable/mcmp/hashtable_op_get_key.c 82.35% <76.92%> (-8.56%) ⬇️
...tures/hashtable/mcmp/hashtable_op_get_random_key.c 100.00% <100.00%> (ø)
...ule/redis/command/module_redis_command_randomkey.c 100.00% <100.00%> (ø)
src/storage/db/storage_db.c 63.71% <100.00%> (+0.42%) ⬆️

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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
None yet
1 participant