Class KubernetesCacheData
- java.lang.Object
-
- com.netflix.spinnaker.clouddriver.kubernetes.caching.agent.KubernetesCacheData
-
public class KubernetesCacheData extends java.lang.ObjectA collection of CacheItem entries used when building up the items being cached by the Kubernetes caching agent. This class supports adding items as well as adding relationships between items.Once all cache items and relationships have been added, calling toCacheData() will return a Collection of CacheData entries that represent all added items and their relationships. The operations supported on the class guarantee that the resulting Collection<CacheData> has the following properties: (1) Each CacheData has a unique cache key, (2) all relationships between CacheData items are bidirectional
-
-
Constructor Summary
Constructors Constructor Description KubernetesCacheData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItem(Keys.CacheKey key, java.util.Map<java.lang.String,java.lang.Object> attributes)Add an item to the cache with specified key and attributes.voidaddRelationship(Keys.CacheKey a, Keys.CacheKey b)Add a bidirectional relationship between two keys.voidaddRelationships(Keys.CacheKey a, java.util.Set<Keys.CacheKey> b)Add a bidirectional relationships between key a and each of the keys in the Set b.java.util.List<com.netflix.spinnaker.cats.cache.CacheData>toCacheData()Return a List of CacheData entries representing the current items in the cache.java.util.Map<java.lang.String,java.util.Collection<com.netflix.spinnaker.cats.cache.CacheData>>toStratifiedCacheData()Return a List of CacheData entries representing the current items in the cache, grouped by the item's group.
-
-
-
Method Detail
-
addItem
public void addItem(Keys.CacheKey key, java.util.Map<java.lang.String,java.lang.Object> attributes)
Add an item to the cache with specified key and attributes. If there is already an item with the given key, the attributes are merged into the existing item's attributes (with the input attributes taking priority).
-
addRelationship
public void addRelationship(Keys.CacheKey a, Keys.CacheKey b)
Add a bidirectional relationship between two keys. If either of the keys is not yet in the cache, an entry is created for that item with an empty map of attributes.
-
addRelationships
public void addRelationships(Keys.CacheKey a, java.util.Set<Keys.CacheKey> b)
Add a bidirectional relationships between key a and each of the keys in the Set b. If any of the encountered keys is not in the cache, an entry is created for that item with an empty map of attributes
-
toCacheData
public java.util.List<com.netflix.spinnaker.cats.cache.CacheData> toCacheData()
Return a List of CacheData entries representing the current items in the cache.
-
toStratifiedCacheData
public java.util.Map<java.lang.String,java.util.Collection<com.netflix.spinnaker.cats.cache.CacheData>> toStratifiedCacheData()
Return a List of CacheData entries representing the current items in the cache, grouped by the item's group.
-
-