Class GrpcBackedCache<K,V>
- java.lang.Object
-
- com.atlassian.bamboo.cluster.atlassiancache.ManagedCacheSupport
-
- com.atlassian.bamboo.cluster.atlassiancache.GrpcBackedCache<K,V>
-
- Type Parameters:
K- key typeV- value type
- All Implemented Interfaces:
CacheRemoteAccessor,com.atlassian.cache.Cache<K,V>,com.atlassian.cache.ManagedCache
public class GrpcBackedCache<K,V> extends ManagedCacheSupport implements com.atlassian.cache.Cache<K,V>, CacheRemoteAccessor
A cluster-awareCachebacked by a gRPC transport that transforms keys/values using XStream serialization/deserialization. There is no support for modifying the cache settings after the cache has been created.- Since:
- 9.5
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.cluster.atlassiancache.ManagedCacheSupport
cacheManager, name
-
-
Constructor Summary
Constructors Constructor Description GrpcBackedCache(@NotNull String name, @Nullable com.atlassian.cache.CacheLoader<K,V> cacheLoader, @NotNull GrpcBackedCacheManager cacheManager, @Nullable CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster, @NotNull XStreamManager xStreamManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(@NotNull com.atlassian.cache.CacheEntryListener<K,V> listener, boolean includeValues)voidclear()booleancontainsKey(K key)Vget(K key)Vget(K key, @NotNull com.atlassian.cache.Supplier<? extends V> valueSupplier)@NotNull Map<K,V>getBulk(@NotNull Set<K> keys, @NotNull Function<Set<K>,Map<K,V>> valuesSupplier)voidgetBulkFromRemote(@Nullable Map<String,String> entriesToPopulate)@NotNull Collection<K>getKeys()com.google.common.cache.Cache<K,V>getLocalStoreDelegate()@NotNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>>getStatistics()voidprocessRemotePut(@Nullable String key, @Nullable String value)voidprocessRemotePutIfAbsent(@Nullable String key, @Nullable String value)voidprocessRemoteRemove(@Nullable String key)voidprocessRemoteRemove(@Nullable String key, @Nullable String value)voidprocessRemoteRemoveAll()voidprocessRemoteReplace(@Nullable String key, @Nullable String oldValue, @Nullable String newValue)voidput(K key, V value)VputIfAbsent(K key, V value)voidremove(K key)booleanremove(K key, V value)voidremoveAll()voidremoveListener(@NotNull com.atlassian.cache.CacheEntryListener<K,V> listener)booleanreplace(K key, V oldValue, V newValue)-
Methods inherited from class com.atlassian.bamboo.cluster.atlassiancache.ManagedCacheSupport
currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getCacheSettings, getName, isFlushable, isLocal, isReplicateAsynchronously, isReplicateViaCopy, isStatisticsEnabled, setStatistics, updateExpireAfterAccess, updateExpireAfterWrite, updateMaxEntries
-
-
-
-
Constructor Detail
-
GrpcBackedCache
public GrpcBackedCache(@NotNull @NotNull String name, @Nullable @Nullable com.atlassian.cache.CacheLoader<K,V> cacheLoader, @NotNull @NotNull GrpcBackedCacheManager cacheManager, @Nullable @Nullable CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster, @NotNull @NotNull XStreamManager xStreamManager)
-
-
Method Detail
-
containsKey
public boolean containsKey(@NotNull K key)
-
getKeys
@NotNull public @NotNull Collection<K> getKeys()
-
get
@NotNull public V get(@NotNull K key, @NotNull @NotNull com.atlassian.cache.Supplier<? extends V> valueSupplier)
-
processRemotePut
public void processRemotePut(@Nullable @Nullable String key, @Nullable @Nullable String value)- Specified by:
processRemotePutin interfaceCacheRemoteAccessor
-
processRemotePutIfAbsent
public void processRemotePutIfAbsent(@Nullable @Nullable String key, @Nullable @Nullable String value)- Specified by:
processRemotePutIfAbsentin interfaceCacheRemoteAccessor
-
remove
public void remove(@NotNull K key)
-
processRemoteRemove
public void processRemoteRemove(@Nullable @Nullable String key)- Specified by:
processRemoteRemovein interfaceCacheRemoteAccessor
-
processRemoteRemove
public void processRemoteRemove(@Nullable @Nullable String key, @Nullable @Nullable String value)- Specified by:
processRemoteRemovein interfaceCacheRemoteAccessor
-
removeAll
public void removeAll()
-
clear
public void clear()
- Specified by:
clearin interfacecom.atlassian.cache.ManagedCache
-
processRemoteRemoveAll
public void processRemoteRemoveAll()
- Specified by:
processRemoteRemoveAllin interfaceCacheRemoteAccessor
-
processRemoteReplace
public void processRemoteReplace(@Nullable @Nullable String key, @Nullable @Nullable String oldValue, @Nullable @Nullable String newValue)- Specified by:
processRemoteReplacein interfaceCacheRemoteAccessor
-
getBulk
@NotNull public @NotNull Map<K,V> getBulk(@NotNull @NotNull Set<K> keys, @NotNull @NotNull Function<Set<K>,Map<K,V>> valuesSupplier)
-
getBulkFromRemote
public void getBulkFromRemote(@Nullable @Nullable Map<String,String> entriesToPopulate)- Specified by:
getBulkFromRemotein interfaceCacheRemoteAccessor
-
getStatistics
@NotNull public @NotNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>> getStatistics()
- Specified by:
getStatisticsin interfacecom.atlassian.cache.ManagedCache- Overrides:
getStatisticsin classManagedCacheSupport
-
addListener
public void addListener(@NotNull @NotNull com.atlassian.cache.CacheEntryListener<K,V> listener, boolean includeValues)
-
-