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, ConfigurableCache<K,V>, ConfluenceCache<K,V>
- Direct Known Subclasses:
- ConfluenceMonitoringLockingCache
@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 supplied
ConfluenceMonitoring instance.
- Since:
- 5.6
|
Method Summary |
void |
addListener(com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener,
boolean b)
|
void |
clear()
|
boolean |
containsKey(K k)
|
protected Split |
createLockSplit()
|
protected Split |
createReadSplit()
|
protected Split |
createSplit(String operation)
|
protected Split |
createUnlockSplit()
|
protected Split |
createWriteSplit()
|
Long |
currentExpireAfterAccessMillis()
|
Long |
currentExpireAfterWriteMillis()
|
Integer |
currentMaxEntries()
|
V |
get(K key)
|
V |
get(K k,
com.atlassian.cache.Supplier<? extends V> supplier)
|
Collection<K> |
getKeys()
|
String |
getName()
|
SortedMap<com.atlassian.cache.CacheStatisticsKey,com.atlassian.util.concurrent.Supplier<Long>> |
getStatistics()
|
boolean |
isFlushable()
|
boolean |
isLocal()
|
boolean |
isReplicateAsynchronously()
|
boolean |
isReplicateViaCopy()
|
void |
put(K key,
V value)
|
V |
putIfAbsent(K key,
V value)
|
void |
remove(K key)
|
boolean |
remove(K key,
V value)
|
void |
removeAll()
|
void |
removeListener(com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener)
|
boolean |
replace(K key,
V oldValue,
V newValue)
|
void |
setTimeToLive(long timeToLive,
TimeUnit timeUnit)
Update the time to live. |
boolean |
updateExpireAfterAccess(long expireAfter,
TimeUnit timeUnit)
|
boolean |
updateExpireAfterWrite(long expireAfter,
TimeUnit timeUnit)
|
boolean |
updateMaxEntries(int newValue)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConfluenceMonitoringCache
public ConfluenceMonitoringCache(ConfluenceCache<K,V> cache,
ConfluenceMonitoring confluenceMonitoring)
- Constructs a new instance.
- Parameters:
cache - the (Cache) interface to the cache to be monitoredconfluenceMonitoring - the ConfluenceMonitoring instance to use for monitoring
get
public V get(@Nonnull
K key)
- Specified by:
get in interface com.atlassian.cache.Cache<K,V>
get
@Nonnull
public V get(@Nonnull
K k,
@Nonnull
com.atlassian.cache.Supplier<? extends V> supplier)
- Specified by:
get in interface com.atlassian.cache.Cache<K,V>
containsKey
public boolean containsKey(@Nonnull
K k)
- Specified by:
containsKey in interface com.atlassian.cache.Cache<K,V>
getKeys
@Nonnull
public Collection<K> getKeys()
- Specified by:
getKeys in interface com.atlassian.cache.Cache<K,V>
put
public void put(@Nonnull
K key,
@Nonnull
V value)
- Specified by:
put in interface com.atlassian.cache.Cache<K,V>
remove
public void remove(@Nonnull
K key)
- Specified by:
remove in interface com.atlassian.cache.Cache<K,V>
removeAll
public void removeAll()
- Specified by:
removeAll in interface com.atlassian.cache.Cache<K,V>
putIfAbsent
public V putIfAbsent(@Nonnull
K key,
@Nonnull
V value)
- Specified by:
putIfAbsent in interface com.atlassian.cache.Cache<K,V>
replace
public boolean replace(@Nonnull
K key,
@Nonnull
V oldValue,
@Nonnull
V newValue)
- Specified by:
replace in interface com.atlassian.cache.Cache<K,V>
addListener
public void addListener(@Nonnull
com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener,
boolean b)
- Specified by:
addListener in interface com.atlassian.cache.Cache<K,V>
removeListener
public void removeListener(@Nonnull
com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener)
- Specified by:
removeListener in interface com.atlassian.cache.Cache<K,V>
remove
public boolean remove(@Nonnull
K key,
@Nonnull
V value)
- Specified by:
remove in interface com.atlassian.cache.Cache<K,V>
clear
public void clear()
- Specified by:
clear in interface com.atlassian.cache.ManagedCache
getName
@Nonnull
public String getName()
- Specified by:
getName in interface com.atlassian.cache.Cache<K,V>- Specified by:
getName in interface com.atlassian.cache.ManagedCache
isFlushable
public boolean isFlushable()
- Specified by:
isFlushable in interface com.atlassian.cache.ManagedCache
currentMaxEntries
@Nullable
public Integer currentMaxEntries()
- Specified by:
currentMaxEntries in interface com.atlassian.cache.ManagedCache
updateMaxEntries
public boolean updateMaxEntries(int newValue)
- Specified by:
updateMaxEntries in interface com.atlassian.cache.ManagedCache
currentExpireAfterAccessMillis
@Nullable
public Long currentExpireAfterAccessMillis()
- Specified by:
currentExpireAfterAccessMillis in interface com.atlassian.cache.ManagedCache
updateExpireAfterAccess
public boolean updateExpireAfterAccess(long expireAfter,
@Nonnull
TimeUnit timeUnit)
- Specified by:
updateExpireAfterAccess in interface com.atlassian.cache.ManagedCache
currentExpireAfterWriteMillis
@Nullable
public Long currentExpireAfterWriteMillis()
- Specified by:
currentExpireAfterWriteMillis in interface com.atlassian.cache.ManagedCache
updateExpireAfterWrite
public boolean updateExpireAfterWrite(long expireAfter,
@Nonnull
TimeUnit timeUnit)
- Specified by:
updateExpireAfterWrite in interface com.atlassian.cache.ManagedCache
isLocal
public boolean isLocal()
- Specified by:
isLocal in interface com.atlassian.cache.ManagedCache
isReplicateAsynchronously
public boolean isReplicateAsynchronously()
- Specified by:
isReplicateAsynchronously in interface com.atlassian.cache.ManagedCache
isReplicateViaCopy
public boolean isReplicateViaCopy()
- Specified by:
isReplicateViaCopy in interface com.atlassian.cache.ManagedCache
getStatistics
@Nonnull
public SortedMap<com.atlassian.cache.CacheStatisticsKey,com.atlassian.util.concurrent.Supplier<Long>> getStatistics()
- Specified by:
getStatistics in interface com.atlassian.cache.ManagedCache
setTimeToLive
public void setTimeToLive(long timeToLive,
TimeUnit timeUnit)
- Description copied from interface:
ConfigurableCache
- Update the time to live. Please note, some implementations cannot store time values smaller than
TimeUnit.SECONDS.
- Specified by:
setTimeToLive in interface ConfigurableCache<K,V>
- Parameters:
timeToLive - valuetimeUnit - unit of time
createSplit
protected Split createSplit(String operation)
createReadSplit
protected Split createReadSplit()
createWriteSplit
protected Split createWriteSplit()
createLockSplit
protected Split createLockSplit()
createUnlockSplit
protected Split createUnlockSplit()
Copyright © 2003–2015 Atlassian. All rights reserved.