[cmis] add read only cache decorator (#562)#103
Merged
yxieca merged 1 commit intoAzure:202501from Aug 7, 2025
Merged
Conversation
* Add read only cache decorator Defined read only cache decorator after logger setup. Cached return values of static get methods to reduce EEPROM reads. Add unit tests. Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Refactor code and update UT Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Remove unnecessary decorator Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Add clear cache Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Move cache api to utils dir Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Refactor: relocate cache clearing to test helper Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Add utils sub package Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Support cache all non-empty collections Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Add clear cache when SFP module removal event happen Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * [cmis] add cache enable flag Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Add transceiver remove api Add remove api for transceiver. Move clear cache api to UT. Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Move MEDIA_TYPE_FIELD lookup out of the loop Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Set caching as default enabled Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> * Add line back Signed-off-by: Jianyue Wu <jianyuew@nvidia.com> --------- Signed-off-by: Jianyue Wu <jianyuew@nvidia.com>
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.
Defined read only cache decorator after logger setup. Cached return values of static get methods to reduce EEPROM reads. Add unit tests.