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

Handle apteryx_set_tree / apteryx_prune / apteryx_watch_tree as a tree #431

Merged
merged 8 commits into from
Sep 20, 2024

Conversation

blairsteven
Copy link
Contributor

Maintain GNode trees through apteryx_set_tree / apteryx_prune watch callback matching to improve performance (~50x) with large trees.

Add a new larger set tree with a watch. This is the target for upcoming
tree callback matching.
Add cb_match_tree. This function returns a GList of struct cb_tree_info
with the usual cb_info_t structure populated, with a newly allocated
GNode tree of the data that matches the callback.
The new config_match_tree function allows us to match the whole change
set in a set tree or prune against all watchers and validators. These
callbacks can then be called with the matching tree as a single RPC -
this can save a lot of processing for large changesets.
apteryx.c Outdated Show resolved Hide resolved
apteryx.c Show resolved Hide resolved
}

/* We need to break a compound root up to match nicely. */
if (root->data && strchr ((char*)root->data, '/'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this always get hit???? even if root="/" ?

Handle the unlikely case that the rpc_msg_decode_tree fails to build a
tree.
…eryx_set_tree

apteryx_set_tree and apteryx_query both check that the root key in the
tree is a valid apteryx path. It handle this ensure that the GNode that
is created when parsing the tree has a "/" if it is not a longer path.
@carlgsmith carlgsmith merged commit e974270 into master Sep 20, 2024
1 check passed
@carlgsmith carlgsmith deleted the cb_match_tree branch September 20, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants