-
Notifications
You must be signed in to change notification settings - Fork 81
feat(kv-ir): Add a function signature C++ concept for the callback called when a new projected schema-tree node is read. #859
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
feat(kv-ir): Add a function signature C++ concept for the callback called when a new projected schema-tree node is read. #859
Conversation
WalkthroughA new header file, Changes
Sequence Diagram(s)sequenceDiagram
participant UserCode as User Callback
participant IRStream as IR Stream Search
participant SchemaTree as Schema Tree
IRStream->>UserCode: Invoke callback (is_auto_generated, node_id, key_path)
UserCode-->>IRStream: Returns outcome_v2::std_result<void>
IRStream->>SchemaTree: Process new projected schema-tree node (if callback succeeds)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
* Callback parameters: | ||
* - `bool is_auto_generated`: Whether the schema tree node is auto-generated. | ||
* - `SchemaTree::Node::id_t schema_tree_node_id`: The ID of the resolved schema tree node. | ||
* - `std::string_view key_path`: The key path of the resolved projection. | ||
* | ||
* Callback return values: | ||
* - A void result on success. | ||
* - A user-defined error code indicating the failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirkrodrigues Do u have any suggestions on how to document such a signature?
components/core/src/clp/ffi/ir_stream/search/ProjectionResolutionCallbackReq.hpp
Outdated
Show resolved
Hide resolved
* - A user-defined error code indicating the failure. | ||
*/ | ||
template <typename ProjectionResolutionCallbackType> | ||
concept ProjectionResolutionCallbackReq = std::is_invocable_r_v< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about NewSchemaTreeProjectionNodeCallbackReq
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, we decided to use NewProjectedSchemaTreeNodeCallbackReq
.
…ionCallbackReq.hpp Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the PR title, how about:
feat(kv-ir): Add a function signature C++ concept for the callback called when a new projected schema-tree node is read.
Description
This PR is one of the series #840.
This PR implements the projection resolution callback's signature as a concept. Unlike the prototype implementation, this callback signature is defined as a standalone concept instead of inside
IrUnitHandlerInterface
, since it is not designed to handle any IR unit.The signature is documented in the docstring.
Checklist
breaking change.
Validation performed
Summary by CodeRabbit