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

issue 30528 remove sync cache gets #30529

Merged
merged 4 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public CacheProviderStats getStats() {
: Config.getIntProperty("cache." + DEFAULT_CACHE + ".size");

final int seconds =
isDefault ? Config.getIntProperty("cache." + DEFAULT_CACHE + ".seconds", 100)
isDefault ? Config.getIntProperty("cache." + DEFAULT_CACHE + ".seconds", -1)
: Config.getIntProperty("cache." + group + ".seconds", -1);

com.github.benmanes.caffeine.cache.stats.CacheStats cstats = foundCache.stats();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class TimedCacheProvider extends CacheProvider {
private final ConcurrentHashMap<String, Cache<String, Object>> groups = new ConcurrentHashMap<>();

static final String DEFAULT_CACHE = CacheProviderAPI.DEFAULT_CACHE;
static final String LIVE_CACHE_PREFIX = CacheProviderAPI.LIVE_CACHE_PREFIX;
static final String WORKING_CACHE_PREFIX = CacheProviderAPI.WORKING_CACHE_PREFIX;


private final HashSet<String> availableCaches = new HashSet<>();
Expand Down Expand Up @@ -94,7 +92,7 @@ public void put(String group, String key, Object content) {
}

@Override
public synchronized Object get(String group, String key) {
public Object get(String group, String key) {
// Get the cache for the given group
Cache cache = getCache(group);
return cache.getIfPresent(key);
Expand Down Expand Up @@ -204,7 +202,7 @@ private String cacheKey(String group, String key) {
return (group + ":" + key).toLowerCase();
}

private synchronized Cache<String, Object> getCache(String cacheName) {
private Cache<String, Object> getCache(String cacheName) {
if (cacheName == null) {
throw new DotStateException("Null cache region passed in");
}
Expand Down Expand Up @@ -265,4 +263,4 @@ private synchronized Cache<String, Object> getCache(String cacheName) {



}
}