Package com.atlassian.confluence.cache
Class ConfluenceMonitoringCache<K,V>
- java.lang.Object
-
- com.atlassian.confluence.cache.ConfluenceMonitoringCache<K,V>
-
- All Implemented Interfaces:
com.atlassian.cache.Cache<K,V>
,com.atlassian.cache.ManagedCache
,ConfluenceCache<K,V>
@Internal public class ConfluenceMonitoringCache<K,V> extends Object implements ConfluenceCache<K,V>
A wrapper for monitoring the performance of Confluence caches. The performance is monitored using the suppliedConfluenceMonitoring
instance.- Since:
- 5.6
-
-
Constructor Summary
Constructors Constructor Description ConfluenceMonitoringCache(ConfluenceCache<K,V> cache, ConfluenceMonitoring confluenceMonitoring)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener, boolean b)
void
clear()
boolean
containsKey(@NonNull K k)
protected Split
createLockSplit()
protected Split
createReadSplit()
protected Split
createSplit(String operation)
protected Split
createUnlockSplit()
protected Split
createWriteSplit()
@Nullable Long
currentExpireAfterAccessMillis()
@Nullable Long
currentExpireAfterWriteMillis()
@Nullable Integer
currentMaxEntries()
V
get(@NonNull K key)
@NonNull V
get(@NonNull K k, @NonNull com.atlassian.cache.Supplier<? extends V> supplier)
@Nullable com.atlassian.instrumentation.caches.CacheCollector
getCacheCollector()
@NonNull Collection<K>
getKeys()
@NonNull String
getName()
@NonNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>>
getStatistics()
boolean
isFlushable()
boolean
isLocal()
boolean
isReplicateAsynchronously()
boolean
isReplicateViaCopy()
boolean
isStatisticsEnabled()
void
put(@NonNull K key, @NonNull V value)
V
putIfAbsent(@NonNull K key, @NonNull V value)
void
remove(@NonNull K key)
boolean
remove(@NonNull K key, @NonNull V value)
void
removeAll()
void
removeListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener)
boolean
replace(@NonNull K key, @NonNull V oldValue, @NonNull V newValue)
void
setStatistics(boolean b)
boolean
updateExpireAfterAccess(long expireAfter, @NonNull TimeUnit timeUnit)
boolean
updateExpireAfterWrite(long expireAfter, @NonNull TimeUnit timeUnit)
boolean
updateMaxEntries(int newValue)
-
-
-
Constructor Detail
-
ConfluenceMonitoringCache
public ConfluenceMonitoringCache(ConfluenceCache<K,V> cache, ConfluenceMonitoring confluenceMonitoring)
Constructs a new instance.- Parameters:
cache
- the (Cache
) interface to the cache to be monitoredconfluenceMonitoring
- theConfluenceMonitoring
instance to use for monitoring
-
-
Method Detail
-
get
public @NonNull V get(@NonNull K k, @NonNull com.atlassian.cache.Supplier<? extends V> supplier)
-
containsKey
public boolean containsKey(@NonNull K k)
-
getKeys
public @NonNull Collection<K> getKeys()
-
remove
public void remove(@NonNull K key)
-
removeAll
public void removeAll()
-
addListener
public void addListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener, boolean b)
-
removeListener
public void removeListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener)
-
clear
public void clear()
- Specified by:
clear
in interfacecom.atlassian.cache.ManagedCache
-
getName
public @NonNull String getName()
-
isFlushable
public boolean isFlushable()
- Specified by:
isFlushable
in interfacecom.atlassian.cache.ManagedCache
-
currentMaxEntries
public @Nullable Integer currentMaxEntries()
- Specified by:
currentMaxEntries
in interfacecom.atlassian.cache.ManagedCache
-
updateMaxEntries
public boolean updateMaxEntries(int newValue)
- Specified by:
updateMaxEntries
in interfacecom.atlassian.cache.ManagedCache
-
currentExpireAfterAccessMillis
public @Nullable Long currentExpireAfterAccessMillis()
- Specified by:
currentExpireAfterAccessMillis
in interfacecom.atlassian.cache.ManagedCache
-
updateExpireAfterAccess
public boolean updateExpireAfterAccess(long expireAfter, @NonNull TimeUnit timeUnit)
- Specified by:
updateExpireAfterAccess
in interfacecom.atlassian.cache.ManagedCache
-
currentExpireAfterWriteMillis
public @Nullable Long currentExpireAfterWriteMillis()
- Specified by:
currentExpireAfterWriteMillis
in interfacecom.atlassian.cache.ManagedCache
-
updateExpireAfterWrite
public boolean updateExpireAfterWrite(long expireAfter, @NonNull TimeUnit timeUnit)
- Specified by:
updateExpireAfterWrite
in interfacecom.atlassian.cache.ManagedCache
-
isLocal
public boolean isLocal()
- Specified by:
isLocal
in interfacecom.atlassian.cache.ManagedCache
-
isReplicateAsynchronously
public boolean isReplicateAsynchronously()
- Specified by:
isReplicateAsynchronously
in interfacecom.atlassian.cache.ManagedCache
-
isReplicateViaCopy
public boolean isReplicateViaCopy()
- Specified by:
isReplicateViaCopy
in interfacecom.atlassian.cache.ManagedCache
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Specified by:
isStatisticsEnabled
in interfacecom.atlassian.cache.ManagedCache
-
setStatistics
public void setStatistics(boolean b)
- Specified by:
setStatistics
in interfacecom.atlassian.cache.ManagedCache
-
getStatistics
public @NonNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>> getStatistics()
- Specified by:
getStatistics
in interfacecom.atlassian.cache.ManagedCache
-
getCacheCollector
public @Nullable com.atlassian.instrumentation.caches.CacheCollector getCacheCollector()
- Specified by:
getCacheCollector
in interfacecom.atlassian.cache.ManagedCache
-
createReadSplit
protected Split createReadSplit()
-
createWriteSplit
protected Split createWriteSplit()
-
createLockSplit
protected Split createLockSplit()
-
createUnlockSplit
protected Split createUnlockSplit()
-
-