Skip to content
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

Use separate caches for different Container caching needs #5921

Merged
merged 3 commits into from
Oct 5, 2024

Conversation

labkey-jeckels
Copy link
Contributor

Rationale

We need to cache a few different things about containers. We can eliminate casting and awkward cache clearing by using separate caches.

Changes

  • One cache per caching use case!

Copy link
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

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

Love it, was thinking about doing this myself last time I looked at this class

if (null != parent)
CACHE.remove(CONTAINER_CHILDREN_PREFIX + parent.getId());
CACHE.remove(toString(c));
CACHE.remove(c.getId());

// blow away the all children caches
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// blow away the all children caches
// blow away the children caches

CACHE.put(CONTAINER_PREFIX + toString(c), c);
CACHE.put(CONTAINER_PREFIX + c.getId(), c);
CACHE.put(toString(c), c);
CACHE.put(c.getId(), c);
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're caching every container by ID and path, shouldn't the capacity be 2 * MAX?

@labkey-jeckels labkey-jeckels merged commit c59ab73 into develop Oct 5, 2024
3 of 4 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_containerCache branch October 5, 2024 18:31
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