Class LocalRegionCacheMaxSizeAdjuster
java.lang.Object
com.atlassian.confluence.impl.cache.hazelcast.hibernate.LocalRegionCacheMaxSizeAdjuster
Listens to the MaxCacheSizeChangedEvent events and adjust max cache size for local region caches.
It was required because 8.9.0 switched to Hazelcast 5 which uses Caffeine for caches. Even though Caffeine caches
allow to change their cache sizes via setMaximum method, LocalRegionCache does not allow to do this. As a result,
LocalRegionCacheWithAdjustableMaxSize was introduced that allows to call setMaximum on the underlying caches.
- Since:
- 8.9.0
-
Constructor Summary
ConstructorsConstructorDescriptionLocalRegionCacheMaxSizeAdjuster
(com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescription@Nullable Long
getCacheSize
(String cacheName) void
onMaxEntriesSettingChangedLocally
(MaxCacheSizeChangedEvent maxCacheSizeChangedEvent) void
onMaxEntriesSettingChangedRemotely
(ClusterEventWrapper clusterEventWrapper) void
void
registerLocalRegionCache
(com.hazelcast.hibernate.local.LocalRegionCache localRegionCache) void
-
Constructor Details
-
LocalRegionCacheMaxSizeAdjuster
public LocalRegionCacheMaxSizeAdjuster(com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
registerLocalRegionCache
public void registerLocalRegionCache(com.hazelcast.hibernate.local.LocalRegionCache localRegionCache) -
postConstruct
@PostConstruct public void postConstruct() -
unregisterForEvents
@PreDestroy public void unregisterForEvents() -
onMaxEntriesSettingChangedRemotely
@EventListener public void onMaxEntriesSettingChangedRemotely(ClusterEventWrapper clusterEventWrapper) -
onMaxEntriesSettingChangedLocally
@EventListener public void onMaxEntriesSettingChangedLocally(MaxCacheSizeChangedEvent maxCacheSizeChangedEvent) -
getCacheSize
-