Class KubernetesCacheData
java.lang.Object
com.netflix.spinnaker.clouddriver.kubernetes.caching.agent.KubernetesCacheData
A 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddItem(Keys.CacheKey key, Map<String, Object> attributes) Add an item to the cache with specified key and attributes.voidAdd a bidirectional relationship between two keys.voidAdd a bidirectional relationships between key a and each of the keys in the Set b.List<com.netflix.spinnaker.cats.cache.CacheData>Return a List of CacheData entries representing the current items in the cache.Map<String,Collection<com.netflix.spinnaker.cats.cache.CacheData>> Return a List of CacheData entries representing the current items in the cache, grouped by the item's group.
-
Constructor Details
-
KubernetesCacheData
public KubernetesCacheData()
-
-
Method Details
-
addItem
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
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
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
Return a List of CacheData entries representing the current items in the cache. -
toStratifiedCacheData
Return a List of CacheData entries representing the current items in the cache, grouped by the item's group.
-