TranslClient: Use new translib subscription APIs#122
Merged
anand-kumar-subramanian merged 4 commits intosonic-net:masterfrom Jun 16, 2023
Merged
TranslClient: Use new translib subscription APIs#122anand-kumar-subramanian merged 4 commits intosonic-net:masterfrom
anand-kumar-subramanian merged 4 commits intosonic-net:masterfrom
Conversation
Added gnmipb.Notification as a member of the Value messgae object defined by sonic_internal.proto. Data clients now can fill a complete Notification object instead of timestamp, path, TypedValue separately.
Use TranslClient to handle the subscribe requests when origin is "openconfig". Fallback to the existing target based identification logic if origin is not given.
fab14b3 to
84bb5a6
Compare
StreamRun() enhancements: - Create a new SubscribeSession in the beginning and pass it to all further translib API calls - Call translib.IsSubscribeSupported() to reasolve preferences of the requested paths. This also splits the target_defined request into on_change and sample paths. - Use one translib.Subscribe() call passing all on_change enabled paths, if there are any. This will handle initial updates and subsequent on_change notifications. - Use one translib.Stream() call for each sample subscribe path, if present. This will be called in a loop at every sample interval. - Maintain the ygot objects received for each translib.Stream() call in a cache. Diff the current set of objects with the objects from the previous iteration to resolve deleted paths and modified values (when suppress_redundant is enabled). PollRun() and OnceRun() enhancements: - Call translib.Stream() with each subscribed path to generate notification data. - In poll mode, this is repeated when a poll message is received
84bb5a6 to
5b854b6
Compare
7be32d0 to
aa96dd5
Compare
anand-kumar-subramanian
approved these changes
Jun 16, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
PR sonic-net/sonic-mgmt-common#92 modified the translib APIs to implement the new subscription feature (HLD sonic-net/SONiC#1287). The gNMI server code also needs to be changed accordingly.
How I did it
TranslClientto use the new translib subscription APIsTranslClientfor handling subscription when theoriginis set to "openconfig". Existingtargetbased handling will be used whenoriginis not specifiedThis PR requires sonic-net/sonic-mgmt-common#92 to be merged first.
How to verify it
Verified subscription for openconfig-interfaces and openconfig-acl paths
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)