Skip to content

[cmis] add read only cache decorator (#562)#103

Merged
yxieca merged 1 commit intoAzure:202501from
yxieca:202501
Aug 7, 2025
Merged

[cmis] add read only cache decorator (#562)#103
yxieca merged 1 commit intoAzure:202501from
yxieca:202501

Conversation

@yxieca
Copy link

@yxieca yxieca commented Aug 7, 2025

  • 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.

* 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>
@yxieca yxieca merged commit e4f5fbf into Azure:202501 Aug 7, 2025
3 checks passed
@yxieca yxieca deleted the 202501 branch August 7, 2025 00:57
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