-
Notifications
You must be signed in to change notification settings - Fork 120
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
[Namespace]: Reduce time taken during get_all from all namespaces #137
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ada41e2
Add dict in Namespace class to maintain a mapping of
SuvarnaMeenakshi 6e1c4a7
Remove trailing whitespace.
SuvarnaMeenakshi 9f23f0b
Remove dbs_get_all function.
SuvarnaMeenakshi 220323a
Add function to get interface index from queue key.
SuvarnaMeenakshi 473fd98
Fix whitespace.
SuvarnaMeenakshi 4d529ad
Update as per review comments.
SuvarnaMeenakshi 7c18887
Minor correction.
SuvarnaMeenakshi 4267524
Minor fix, unit-test failure.
SuvarnaMeenakshi effc505
Merge remote-tracking branch 'sumeenak/master' into time_fix
SuvarnaMeenakshi 60da036
Fix lgtm error.
SuvarnaMeenakshi 90c804f
Minor update as per review comment.
SuvarnaMeenakshi 61c0d91
Remove usage of dbs_get_all.
SuvarnaMeenakshi 87c4b5b
Fix lgtm un-used variable error.
SuvarnaMeenakshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
I see a common pattern in all the functions like
init_namespace_sync_d*
. They just call the single db function and merge all returned items respectively.How about abstract this high level function and return a dictionary of list, in this case the type is
db -> { if_name_map, if_alias_map, if_id_map, oid_sai_map, oid_name_map, if_oid_namespace }
This comment is also true on
dbs_keys_namespace
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.
In the MIB implementations, we generally use a single dict to look up the if_index etc. If we have a dict of lists, then we will have to loop through this dict for each instance of the db and look for the if_index, which will make the code look bulky in the places where these functions are used.