Skip to content

utils: add wrapper for the loading cache#9638

Closed
shwstppr wants to merge 1 commit intoapache:mainfrom
shapeblue:add-cache-wrapper
Closed

utils: add wrapper for the loading cache#9638
shwstppr wants to merge 1 commit intoapache:mainfrom
shapeblue:add-cache-wrapper

Conversation

@shwstppr
Copy link
Copy Markdown
Contributor

@shwstppr shwstppr commented Sep 5, 2024

Description

Follow up for #9628
Creates a utility class LazyCache which currently wraps Caffeine library Cache class.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@shwstppr
Copy link
Copy Markdown
Contributor Author

shwstppr commented Sep 5, 2024

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

shwstppr added a commit to shapeblue/cloudstack that referenced this pull request Sep 5, 2024
Follow up for apache#9638
Creates a utility class LazyCache which currently wraps Caffeine library Cache class.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Follow up for apache#9628
Creates a utility class LazyCache which currently wraps Caffeine library Cache class.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Project coverage is 15.58%. Comparing base (2245d98) to head (e6f1090).
Report is 164 commits behind head on main.

Files with missing lines Patch % Lines
...a/org/apache/cloudstack/utils/cache/LazyCache.java 93.75% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##               main    #9638     +/-   ##
===========================================
  Coverage     15.57%   15.58%             
- Complexity    12056    12060      +4     
===========================================
  Files          5506     5507      +1     
  Lines        482919   482932     +13     
  Branches      61184    62859   +1675     
===========================================
+ Hits          75233    75245     +12     
  Misses       399375   399375             
- Partials       8311     8312      +1     
Flag Coverage Δ
uitests 4.17% <ø> (ø)
unittests 16.36% <94.44%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10982

import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;

public class LazyCache<K, V> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit - CacheUtils ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intentionally didn't use *Utils as we are/will be creating objects of this class unlike other static Utils classes. Any other suggestions maybe?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about org.apache.cloudstack.utils.Cache, @shwstppr ?

@yadvr yadvr added this to the 4.20.0.0 milestone Sep 5, 2024
@yadvr yadvr requested a review from DaanHoogland September 5, 2024 06:54
Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 5, 2024

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@shwstppr shwstppr marked this pull request as ready for review September 6, 2024 11:16
@JoaoJandre JoaoJandre modified the milestones: 4.20.0.0, 4.21.0.0 Sep 10, 2024
@yadvr yadvr modified the milestones: 4.21.0.0, 4.20.1.0 Sep 12, 2024
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 12, 2024

@DaanHoogland @JoaoJandre do we need manual testing or is the smoketests good enough? Looks like just refactoring to me.

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-11458)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 51399 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9638-t11458-kvm-ol8.zip
Smoke tests completed. 138 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_secure_vm_migration Error 400.00 test_vm_life_cycle.py

@yadvr yadvr modified the milestones: 4.20.1.0, 4.20.0.0 Sep 17, 2024
@apache apache deleted a comment from blueorangutan Sep 17, 2024
@yadvr yadvr requested a review from JoaoJandre September 17, 2024 10:12
@JoaoJandre
Copy link
Copy Markdown
Contributor

@shwstppr @rohityadavcloud why is this needed for 4.20? It seems like it could go in 4.20.1

@shwstppr
Copy link
Copy Markdown
Contributor Author

@JoaoJandre It is just refactoring and good to have. I'm okay if you want to move it to 4.20.1.

@JoaoJandre JoaoJandre modified the milestones: 4.20.0.0, 4.20.1.0 Sep 18, 2024
@shwstppr
Copy link
Copy Markdown
Contributor Author

shwstppr commented Dec 4, 2024

Closing this as it is part of #9840

@shwstppr shwstppr closed this Dec 4, 2024
@DaanHoogland DaanHoogland deleted the add-cache-wrapper branch December 4, 2024 07:29
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.

6 participants