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.
@kirkrodrigues Do u have any suggestions on how to document such a signature?
| * - 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.
How about NewSchemaTreeProjectionNodeCallbackReq?
There was a problem hiding this comment.
As discussed offline, we decided to use NewProjectedSchemaTreeNodeCallbackReq.
…ionCallbackReq.hpp 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 a function signature C++ concept for the callback called when a new projected schema-tree node is read.
…lled when a new projected schema-tree node is read. (y-scope#859) Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
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