-
Notifications
You must be signed in to change notification settings - Fork 342
Improve decorator to support profile config. #684
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
Open
liuh-80
wants to merge
43
commits into
sonic-net:master
Choose a base branch
from
liuh-80:dev/liuh/add-decorator
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
ed04b93
Install libyang in azure pipeline
liuh-80 3d76913
Add profile config provider.
liuh-80 a5fb199
Add decorator for Yang default value and profile config.
liuh-80 364f353
Fix missing file
liuh-80 269b00e
Fix file mode
liuh-80 44c9a75
Fix build issue
liuh-80 61db251
Fix config issue
liuh-80 4c3c951
Remove add new DB from redis config
liuh-80 6dcbee5
Merge branch 'dev/liuh/install-yang-to-pipeline' into dev/liuh/profil…
liuh-80 4a12abf
Add new database for UT
liuh-80 92acd07
Fix empty file issue
liuh-80 4f10427
Update code
liuh-80 9b60524
Merge remote-tracking branch 'origin' into dev/liuh/profile-provider
liuh-80 57b9f59
Improve UT config file
liuh-80 02af224
Fix build issue
liuh-80 c558e6b
Improve UT
liuh-80 9b0653d
Refactor getall method
liuh-80 508ed04
Merge branch 'dev/liuh/refact-getall' into dev/liuh/profile-provider
liuh-80 35b6774
Remove unecessary change
liuh-80 a2094ce
revert db config change.
liuh-80 eef426a
Fix DB seperator issue
liuh-80 4375c0a
Merge remote-tracking branch 'origin' into dev/liuh/profile-provider
liuh-80 c2a377e
Fix mode issue
liuh-80 7d1770d
Merge branch 'dev/liuh/profile-provider', remote-tracking branch 'ori…
liuh-80 daaf3a4
Change ConfigDbConnector design
liuh-80 040f184
Fix code issue
liuh-80 0a786fb
Fix merge issue
liuh-80 b8a0529
Fix UT break
liuh-80 f83fcd0
Fix UT break
liuh-80 df07e81
Fix UT break
liuh-80 927890f
Fix name lookup issue on Table::set method
liuh-80 4eaaf52
Merge remote-tracking branch 'origin' into dev/liuh/add-decorator
liuh-80 f72ac1e
Merge remote-tracking branch 'origin' into dev/liuh/add-decorator
liuh-80 976c2ec
Merge remote-tracking branch 'origin' into dev/liuh/add-decorator
liuh-80 b146f44
Merge remote-tracking branch 'origin' into dev/liuh/add-decorator
liuh-80 72907c6
Fix code issue
liuh-80 2227950
Merge remote-tracking branch 'origin' into dev/liuh/add-decorator
liuh-80 5d55070
Merge remote-tracking branch 'origin' into dev/liuh/add-decorator
liuh-80 1f045b3
Merge remote-tracking branch 'origin' into dev/liuh/add-decorator
liuh-80 76cc9fe
Fix merge issue
liuh-80 bb9ef3e
Fix include path
liuh-80 b53e789
Fix common path issue
liuh-80 982d35b
Merge branch 'dev/liuh/fix-common-include' into dev/liuh/add-decorator
liuh-80 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 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,8 +23,15 @@ class DecoratorSubscriberStateTable : public SubscriberStateTable | |
| void pops(std::deque<KeyOpFieldsValuesTuple> &vkco, const std::string &prefix = EMPTY_PREFIX) override; | ||
|
|
||
| private: | ||
| std::string m_profile_keyspace; | ||
|
|
||
| std::string m_profile_keyprefix; | ||
|
|
||
| std::shared_ptr<DefaultValueProvider> m_defaultValueProvider; | ||
|
|
||
| /* Handle SubscriberStateTable unknown pattern */ | ||
| void onPopUnknownPattern(RedisMessage& message, std::deque<KeyOpFieldsValuesTuple> &vkco) override; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| void appendDefaultValue(std::string &key, std::string &op, std::vector<FieldValueTuple> &fvs); | ||
| }; | ||
|
|
||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,31 @@ class DecoratorTable : public Table | |
| /* Get an entry field-value from the table */ | ||
| bool hget(const std::string &key, const std::string &field, std::string &value) override; | ||
|
|
||
| /* Get all the keys from the table */ | ||
| void getKeys(std::vector<std::string> &keys) override; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| /* Set an entry in the DB directly and configure ttl for it (op not in use) */ | ||
| void set(const std::string &key, | ||
| const std::vector<FieldValueTuple> &values, | ||
| const std::string &op, | ||
| const std::string &prefix, | ||
| const int64_t &ttl) override; | ||
|
|
||
| /* Delete an entry in the table */ | ||
| void del(const std::string &key, | ||
| const std::string &op = "", | ||
| const std::string &prefix = EMPTY_PREFIX) override; | ||
|
|
||
| /* Set an entry field in the table */ | ||
| void hset(const std::string &key, | ||
| const std::string &field, | ||
| const std::string &value, | ||
| const std::string &op = "", | ||
| const std::string &prefix = EMPTY_PREFIX) override; | ||
|
|
||
| /* Unhide override 'set' methods in base class */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| using Table::set; | ||
|
|
||
| private: | ||
| std::shared_ptr<DefaultValueProvider> m_defaultValueProvider; | ||
| }; | ||
|
|
||
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
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
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.
Do you want to create another Decorator? this new feature is not related to yang default value.