Class Cache<T>
java.lang.Object
io.fabric8.kubernetes.client.informers.cache.Cache<T>
- Type Parameters:
T- type for cache object
public class Cache<T> extends Object implements Indexer<T>
It basically saves and indexes all the entries.
-
Field Summary
Fields Modifier and Type Field Description static StringNAMESPACE_INDEX -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidadd(T obj)Add objectsvoidaddIndexers(Map<String,Function<T,List<String>>> indexersNew)Add additional indexers to the store.voidaddIndexFunc(String indexName, Function<T,List<String>> indexFunc)Add index func.List<T>byIndex(String indexName, String indexKey)By index listvoiddelete(T obj)Delete the object.static <T> StringdeletionHandlingMetaNamespaceKeyFunc(T object)Checks for DeletedFinalStateUnknown objects before calling metaNamespaceKeyFuncTget(T obj)Get objectTgetByKey(String key)Gets get by key.Map<String,Function<T,List<String>>>getIndexers()Returns the indexers registered with the cache.List<T>index(String indexName, Object obj)Get objectsList<String>indexKeys(String indexName, String indexKey)Index keys listvoidisPopulated(boolean isPopulated)Updates the status of cache in case of any API error from Kubernetes serverList<T>list()List all objects in the cache.List<String>listKeys()List keysstatic List<String>metaNamespaceIndexFunc(Object obj)It is a default index function that indexes based on an object's namespacestatic StringmetaNamespaceKeyFunc(Object obj)It's is a convenient default KeyFunc which know show to make keys for API objects which implement HasMetadata interface.voidreplace(List<T> list, String resourceVersion)Replace the content in the cache completely.voidresync()Resyncvoidupdate(T obj)Update the object.voidupdateIndices(T oldObj, T newObj, String key)UpdateIndices modifies the objects location in the managed indexes, if there is an update, you must provide an oldObj
-
Field Details
-
NAMESPACE_INDEX
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
add
Add objects -
getIndexers
Returns the indexers registered with the cache.- Specified by:
getIndexersin interfaceIndexer<T>- Returns:
- registered indexers
-
addIndexers
Description copied from interface:IndexerAdd additional indexers to the store.- Specified by:
addIndexersin interfaceIndexer<T>- Parameters:
indexersNew- indexers to add
-
update
Update the object. -
delete
Delete the object. -
replace
Replace the content in the cache completely. -
resync
public void resync()Resync -
listKeys
List keys -
get
Get object -
list
List all objects in the cache. -
getByKey
Gets get by key. -
index
Get objects -
indexKeys
Index keys list -
byIndex
By index list -
isPopulated
public void isPopulated(boolean isPopulated)Description copied from interface:StoreUpdates the status of cache in case of any API error from Kubernetes server- Specified by:
isPopulatedin interfaceStore<T>- Parameters:
isPopulated- boolean value indicating whether cache is populated or not
-
updateIndices
UpdateIndices modifies the objects location in the managed indexes, if there is an update, you must provide an oldObj- Parameters:
oldObj- old objectnewObj- new objectkey- the key
-
addIndexFunc
Add index func.- Parameters:
indexName- the index nameindexFunc- the index func
-
deletionHandlingMetaNamespaceKeyFunc
Checks for DeletedFinalStateUnknown objects before calling metaNamespaceKeyFunc- Type Parameters:
T- object type- Parameters:
object- the specific object- Returns:
- the key
-
metaNamespaceKeyFunc
It's is a convenient default KeyFunc which know show to make keys for API objects which implement HasMetadata interface. The key uses the format namespace/name unless namespace is empty, then it's just name- Parameters:
obj- specific object- Returns:
- the key
-
metaNamespaceIndexFunc
It is a default index function that indexes based on an object's namespace- Parameters:
obj- the specific object- Returns:
- the indexed value
-