feat(kv-ir): Add QueryHandler API declarations for handling KV-pair IR stream queries.#863
Conversation
…ependency checksum files from a directory.
… abseil-cpp task to absl.
…me Catch2 task to catch.
…k; Rename json task to nlohmann_json.
… Rename ystdlib-cpp task to ystdlib.
…ernal-deps task to core-all-parallel; Remove obsolete comment about submodule download parallelization.
…created before checksums.
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
…der-only libraries.
…ownloaded includes directory.
…downloaded source directory.
|
Warning Rate limit exceeded@LinZhihao-723 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 14 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
## Walkthrough
This change introduces new components for key-value pair IR stream search functionality within the codebase. It adds a templated `QueryHandler` class with stubbed methods for query handling, a dedicated error code enum and error category for query handler errors, and integrates these new files into the unit test build configuration. The error handling is standardized using a custom error code enum and category, and the new handler class is designed with a factory method and strict control over copy/move semantics. All new methods currently return a "not implemented" error.
## Changes
| File(s) | Change Summary |
|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| components/core/CMakeLists.txt | Added `AstEvaluationResult.hpp`, `ErrorCode.cpp`, `ErrorCode.hpp`, and `QueryHandler.hpp` from the `ir_stream/search` module to the unit test source files list. |
| components/core/src/clp/ffi/ir_stream/search/{QueryHandler.hpp, ErrorCode.hpp, ErrorCode.cpp} | Introduced a templated `QueryHandler` class for IR stream search query handling, including a factory method, public stub methods for column resolution and evaluation, and strict copy/move semantics. Defined a new `ErrorCodeEnum` with a `MethodNotImplemented` value, a corresponding `ErrorCode` type alias, and integrated error category specialization with messages. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant Client
participant QueryHandlerFactory as QueryHandler::create
participant QueryHandler
Client->>QueryHandlerFactory: create(callback)
QueryHandlerFactory-->>Client: QueryHandler instance or ErrorCode
Client->>QueryHandler: step_column_resolution(...)
QueryHandler-->>Client: ErrorCode(MethodNotImplemented)
Client->>QueryHandler: evaluate_node_id_value_pairs(...)
QueryHandler-->>Client: ErrorCode(MethodNotImplemented)Suggested reviewers
|
There was a problem hiding this comment.
@kirkrodrigues Can u help review;
- The docstring of this class.
- The docstring and naming of the two APIs:
step_column_resolutionevaluate_node_id_value_pairs
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
components/core/src/clp/ffi/ir_stream/search/QueryHandler.hpp (4)
13-24: Fix minor grammar issue in class documentation.There's a small grammatical error in the class documentation.
-/** - * Class for handle KV-pair IR stream search queries. +/** + * Class for handling KV-pair IR stream search queries.
27-35: TODO item in documentation needs to be completed.The factory method documentation has a placeholder for possible error codes that needs to be completed.
When implementing the method, please update the documentation to list the specific error codes that could be returned.
48-60: TODO item in documentation needs to be completed.The method documentation has a placeholder for possible error codes that needs to be completed.
When implementing the method, please update the documentation to list the specific error codes that could be returned.
62-73: TODO item in documentation needs to be completed.The method documentation has a placeholder for possible error codes that needs to be completed.
When implementing the method, please update the documentation to list the specific error codes that could be returned.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
components/core/CMakeLists.txt(1 hunks)components/core/src/clp/ffi/ir_stream/search/AstEvaluationResult.hpp(1 hunks)components/core/src/clp/ffi/ir_stream/search/QueryHandler.hpp(1 hunks)components/core/src/clp/ffi/ir_stream/search/QueryHandlerErrorCode.cpp(1 hunks)components/core/src/clp/ffi/ir_stream/search/QueryHandlerErrorCode.hpp(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.
**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Preferfalse == <expression>rather than!<expression>.
components/core/src/clp/ffi/ir_stream/search/AstEvaluationResult.hppcomponents/core/src/clp/ffi/ir_stream/search/QueryHandlerErrorCode.hppcomponents/core/src/clp/ffi/ir_stream/search/QueryHandlerErrorCode.cppcomponents/core/src/clp/ffi/ir_stream/search/QueryHandler.hpp
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: centos-stream-9-static-linked-bins
- GitHub Check: centos-stream-9-dynamic-linked-bins
- GitHub Check: ubuntu-jammy-lint
- GitHub Check: ubuntu-jammy-dynamic-linked-bins
- GitHub Check: ubuntu-jammy-static-linked-bins
- GitHub Check: build-macos (macos-14, false)
- GitHub Check: build-macos (macos-13, false)
- GitHub Check: build-macos (macos-14, true)
- GitHub Check: build-macos (macos-15, true)
- GitHub Check: build-macos (macos-15, false)
🔇 Additional comments (7)
components/core/CMakeLists.txt (1)
476-480: LGTM. Build configuration correctly includes new search-related components.The CMakeLists.txt has been properly updated to include all the new files related to the KV-pair IR stream query handling functionality in the unit test target.
components/core/src/clp/ffi/ir_stream/search/AstEvaluationResult.hpp (1)
1-23: LGTM. Well-structured enum implementation with clear documentation.The enum class is well-designed with an appropriate fixed size (uint8_t) and has clear documentation describing the purpose of each evaluation result. The enum values (True, False, Pruned) cover the necessary evaluation states for the search AST.
components/core/src/clp/ffi/ir_stream/search/QueryHandlerErrorCode.cpp (1)
1-21: LGTM. Error category implementation is straightforward and effective.The error category specialization for QueryHandlerErrorCodeEnum correctly provides a descriptive name and appropriate error messages for the defined error codes. The default case ensures future error codes will be handled gracefully.
components/core/src/clp/ffi/ir_stream/search/QueryHandlerErrorCode.hpp (1)
1-23: LGTM. Error code definition is simple and properly integrated with error handling system.The error code enum is appropriately defined with a fixed size and properly marked for integration with the error handling framework. The code is well-structured with clear documentation.
components/core/src/clp/ffi/ir_stream/search/QueryHandler.hpp (3)
85-91: LGTM. Placeholder implementation correctly returns unimplemented error code.The factory method is properly implemented to return a MethodNotImplemented error code, which is appropriate for this initial API definition PR.
93-100: LGTM. Placeholder implementation correctly returns unimplemented error code.The step_column_resolution method is properly implemented to return a MethodNotImplemented error code, which is appropriate for this initial API definition PR.
102-108: LGTM. Placeholder implementation correctly returns unimplemented error code.The evaluate_node_id_value_pairs method is properly implemented to return a MethodNotImplemented error code, which is appropriate for this initial API definition PR.
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
kirkrodrigues
left a comment
There was a problem hiding this comment.
For the PR title, how about:
feat(kv-ir): Add `QueryHandler` API declarations for handling KV-pair IR stream queries.
Also, don't forget to reference the feature request.
QueryHandler template to define APIs for KV-pair IR stream query handling.QueryHandler API declarations for handling KV-pair IR stream queries.
… IR stream queries. (y-scope#863) Co-authored-by: Kirk Rodrigues <2454684+kirkrodrigues@users.noreply.github.com>
Description
References
AstEvaluationResultto represent AST search results. #860.Overview
This PR adds a template
QueryHandlerthat defines APIs for KV-pair IR stream search query handling. This handler maintains a query and is responsible for:This PR defines the APIs above without an actual implementation. The implementation will be added in the coming PRs.
Checklist
breaking change.
Validation performed
Summary by CodeRabbit