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
ConstructorsConstructorDescriptionGrpcBackedCache(@NotNull String name, @Nullable com.atlassian.cache.CacheLoader<K, V> cacheLoader, @NotNull GrpcBackedCacheManager cacheManager, @Nullable CrossNodesRemoteBroadcaster crossNodesRemoteBroadcaster, @NotNull XStreamManager xStreamManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(@NotNull com.atlassian.cache.CacheEntryListener<K, V> listener, boolean includeValues) voidclear()booleancontainsKey(K key) voidgetBulkFromRemote(@Nullable Map<String, String> entriesToPopulate) @NotNull Collection<K> getKeys()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) voidvoidprocessRemoteReplace(@Nullable String key, @Nullable String oldValue, @Nullable String newValue) voidputIfAbsent(K key, V value) voidbooleanvoidvoidremoveListener(@NotNull com.atlassian.cache.CacheEntryListener<K, V> listener) booleanMethods inherited from class com.atlassian.bamboo.cluster.atlassiancache.ManagedCacheSupport
currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getCacheSettings, getName, isFlushable, isLocal, isReplicateAsynchronously, isReplicateViaCopy, isStatisticsEnabled, setStatistics, updateExpireAfterAccess, updateExpireAfterWrite, updateMaxEntriesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.cache.ManagedCache
getCacheCollectorMethods 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:
processRemotePutin interfaceCacheRemoteAccessor
-
putIfAbsent
-
processRemotePutIfAbsent
public void processRemotePutIfAbsent(@Nullable @Nullable String key, @Nullable @Nullable String value) - Specified by:
processRemotePutIfAbsentin interfaceCacheRemoteAccessor
-
remove
-
processRemoteRemove
- Specified by:
processRemoteRemovein interfaceCacheRemoteAccessor
-
remove
-
processRemoteRemove
- 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
-
replace
-
processRemoteReplace
public void processRemoteReplace(@Nullable @Nullable String key, @Nullable @Nullable String oldValue, @Nullable @Nullable String newValue) - Specified by:
processRemoteReplacein interfaceCacheRemoteAccessor
-
getBulk
-
getBulkFromRemote
- 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
-
getLocalStoreDelegate
-
addListener
-
removeListener
-