feat: add new hash expire cmd to pika
- pkhget pkhset
- pkhexpire pkhexpireat
- pkhexpiretime pkhpersist
- pkhttl
Summary by CodeRabbit
-
New Features
- Added multiple command constants for PKHash operations, including
PKHSet,PKHGet, and various expiration commands. - Implemented new command classes for managing PKHashes, enhancing functionality with expiration and persistence features.
- Expanded Redis functionality with new methods for PKHash management, including TTL and key management commands.
- Added multiple command constants for PKHash operations, including
-
Bug Fixes
- Improved error handling for PKHash commands to ensure accurate responses based on metadata validity.
-
Documentation
- Updated documentation to reflect the new methods and functionalities related to PKHashes.
Walkthrough
A new enumerator value PKHASH has been added to the AclCategory enum in include/acl.h. The changes also introduce a series of new command constants in include/pika_command.h and a comprehensive set of command classes in include/pika_pkhash.h for managing PKHash operations. Various methods related to these commands have been implemented across multiple files, including redis.cc, storage.cc, and new unit tests in pkhashes_test.cc. These modifications extend the functionality of the codebase and improve its structure and readability.
Changes
| File Path | Change Summary |
|---|---|
include/acl.h |
Added enumerator PKHASH to AclCategory enum. |
include/pika_command.h |
Introduced new command constants for PKHash operations and added kCmdFlagsPKHash to CmdFlags enum. |
include/pika_pkhash.h |
Added multiple command classes for PKHash operations, including PKHExpireCmd, PKHGetCmd, PKHSetCmd, etc. |
src/pika_client_conn.cc |
Minor formatting change; added a blank line after external variable declarations. |
src/pika_command.cc |
Modified InitCmdTable to include new PKHash commands and improved formatting of existing command initializations. |
src/pika_pkhash.cc |
Implemented command classes for managing hash operations, including methods for expiration, retrieval, and setting values. |
src/storage/include/storage/storage.h |
Added FieldValueTTL struct and new methods for PKHash operations. |
src/storage/include/storage/storage_define.h |
Added enum value kPKHashDataCF to ColumnFamilyIndex. |
src/storage/src/base_filter.h |
Updated header inclusions and added class aliases for PKHashes. |
src/storage/src/base_value_format.h |
Expanded DataType enum to include kPKHashes and updated related structures. |
src/storage/src/pkhash_data_value_format.h |
Introduced classes PKHashDataValue and ParsedPKHashDataValue for encoding and parsing data formats. |
src/storage/src/redis.cc |
Reformatted header inclusions, constructor, and added functionality for new column family. |
src/storage/src/redis.h |
Added methods related to PKHash operations and updated existing method signatures for consistency. |
src/storage/src/redis_hashes.cc |
Reformatted error message handling and updated header inclusions. |
src/storage/src/redis_pkhashes.cc |
Implemented methods for managing PKHashes, including CRUD operations and expiration handling. |
src/storage/src/redis_strings.cc |
Updated method signatures and error handling for consistency. |
src/storage/src/storage.cc |
Added new methods for PKHash commands and adjusted method signatures for clarity. |
src/storage/tests/hashes_test.cc |
Included necessary header files and made minor comment adjustments. |
src/storage/tests/pkhashes_test.cc |
Added comprehensive unit tests for PKHash functionality using Google Test framework. |
Possibly related PRs
-
#2849: This PR introduces a new method
IsTooLargeKeyin theCmdclass and related classes, which checks if a key exceeds a specified size limit. This is relevant as it directly relates to managing key sizes, which is a concern in the main PR's context of adding a new enumerator valuePKHASHthat may involve key management. -
#2901: This PR enhances testing coverage for Redis commands, including those related to key management. It indirectly relates to the main PR by ensuring that commands handling the new
PKHASHcategory are properly tested, which may involve key size considerations. -
#2934: This PR addresses a compilation error related to the handling of compaction in Redis. While it does not directly relate to the changes in the main PR, it reflects ongoing improvements in the Redis codebase that may impact how new features, like the
PKHASHenumerator, are integrated and managed.
Suggested labels
🧹 Updates, ☢️ Bug
Suggested reviewers
- chejinge
- AlexStocks
- Mixficsol
Poem
In the burrow where data hops,
New commands and enums, oh how it pops!
PKHash is here, with functions galore,
Expire and retrieve, who could ask for more?
With tests all set, let the code run free,
Hopping through hashes, as happy as can be! 🐰✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
补充一下TCL测试吧
Bot detected the issue body's language is not English, translate it automatically.
Please add the TCL test
补充一下TCL测试吧
好的,这周补充。
Bot detected the issue body's language is not English, translate it automatically.
Supplement the TCL test
Okay, more to add this week.