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
,com.atlassian.cache.ReadThroughCache<K,
V>
public class GrpcBackedCache<K,V>
extends ManagedCacheSupport
implements com.atlassian.cache.Cache<K,V>, CacheRemoteAccessor
A cluster-aware
Cache
backed 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
ConstructorDescriptionGrpcBackedCache
(@NotNull String name, @Nullable com.atlassian.cache.CacheLoader<K, V> cacheLoader, @NotNull GrpcBackedCacheManager cacheManager, @Nullable CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster, @NotNull XStreamManager xStreamManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(@NotNull com.atlassian.cache.CacheEntryListener<K, V> listener, boolean includeValues) void
clear()
boolean
containsKey
(K key) void
getBulkFromRemote
(@Nullable Map<String, String> entriesToPopulate) @NotNull Collection<K>
getKeys()
void
processRemotePut
(@Nullable String key, @Nullable String value) void
processRemotePutIfAbsent
(@Nullable String key, @Nullable String value) void
processRemoteRemove
(@Nullable String key) void
processRemoteRemove
(@Nullable String key, @Nullable String value) void
void
processRemoteReplace
(@Nullable String key, @Nullable String oldValue, @Nullable String newValue) void
putIfAbsent
(K key, V value) void
boolean
void
void
removeListener
(@NotNull com.atlassian.cache.CacheEntryListener<K, V> listener) boolean
Methods inherited from class com.atlassian.bamboo.cluster.atlassiancache.ManagedCacheSupport
currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getCacheSettings, getName, isFlushable, isLocal, isReplicateAsynchronously, isReplicateViaCopy, isStatisticsEnabled, setStatistics, updateExpireAfterAccess, updateExpireAfterWrite, updateMaxEntries
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.cache.ManagedCache
getCacheCollector
Methods inherited from interface com.atlassian.cache.ReadThroughCache
getName
-
Constructor Details
-
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 Details
-
containsKey
-
getKeys
-
get
-
get
-
put
-
processRemotePut
- Specified by:
processRemotePut
in interfaceCacheRemoteAccessor
-
putIfAbsent
-
processRemotePutIfAbsent
public void processRemotePutIfAbsent(@Nullable @Nullable String key, @Nullable @Nullable String value) - Specified by:
processRemotePutIfAbsent
in interfaceCacheRemoteAccessor
-
remove
-
processRemoteRemove
- Specified by:
processRemoteRemove
in interfaceCacheRemoteAccessor
-
remove
-
processRemoteRemove
- Specified by:
processRemoteRemove
in interfaceCacheRemoteAccessor
-
removeAll
public void removeAll() -
clear
public void clear()- Specified by:
clear
in interfacecom.atlassian.cache.ManagedCache
-
processRemoteRemoveAll
public void processRemoteRemoveAll()- Specified by:
processRemoteRemoveAll
in interfaceCacheRemoteAccessor
-
replace
-
processRemoteReplace
public void processRemoteReplace(@Nullable @Nullable String key, @Nullable @Nullable String oldValue, @Nullable @Nullable String newValue) - Specified by:
processRemoteReplace
in interfaceCacheRemoteAccessor
-
getBulk
-
getBulkFromRemote
- Specified by:
getBulkFromRemote
in interfaceCacheRemoteAccessor
-
getStatistics
@NotNull public @NotNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>> getStatistics()- Specified by:
getStatistics
in interfacecom.atlassian.cache.ManagedCache
- Overrides:
getStatistics
in classManagedCacheSupport
-
getLocalStoreDelegate
-
addListener
-
removeListener
-