Skip to content

Use application-scoped StorageCredentialCache #2022

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

XN137
Copy link
Contributor

@XN137 XN137 commented Jul 10, 2025

currently based on #2021

since StorageCredentialCache is application scoped and its constructor no longer uses the RealmContext passed into getOrCreateStorageCredentialCache we can now let all PolarisEntityManager instances share the same StorageCredentialCache.

@github-project-automation github-project-automation bot moved this to PRs In Progress in Basic Kanban Board Jul 10, 2025
@XN137 XN137 marked this pull request as ready for review July 10, 2025 08:09
@snazy snazy marked this pull request as draft July 10, 2025 08:17
@snazy
Copy link
Member

snazy commented Jul 10, 2025

Converted to "draft state", as it depends on another PR

Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

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

Thanks a ton for this!

dimas-b
dimas-b previously approved these changes Jul 10, 2025
Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Nice refactoring for application-scoped data. From my POV, this PR improves control over Polaris heap usage by consolidating cached credentials in one cache object as opposed to having a (virtually unbounded) collection of caches.

public StorageCredentialCache(
RealmContext realmContext, PolarisConfigurationStore configurationStore) {
this.realmContext = realmContext;
public StorageCredentialCache(PolarisConfigurationStore configurationStore) {
this.configurationStore = configurationStore;
cache =
Caffeine.newBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind making the max cache size (by entries) configurable? Now that the caches is shared across realms, configuring its side is more important to users, I guess.

I suppose the cache size has to be a global configuration (maybe a constructor parameter injected via CDI producers + Quarkus config).

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Jul 10, 2025
@XN137 XN137 force-pushed the application-scoped-StorageCredentialCache branch from eb13f96 to 7f1eaf4 Compare July 11, 2025 07:43
@XN137 XN137 force-pushed the application-scoped-StorageCredentialCache branch from 7f1eaf4 to bf5a42e Compare July 11, 2025 07:56
@XN137
Copy link
Contributor Author

XN137 commented Jul 11, 2025

rebased after 19f44d8 due to conflicts

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.

3 participants