Class Cache<T>
- java.lang.Object
-
- io.fabric8.kubernetes.client.informers.cache.Cache<T>
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAMESPACE_INDEX
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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.static StringnamespaceKeyFunc(String objectNamespace, String objectName)Default index function that indexes based on an object's namespace and name.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 Detail
-
NAMESPACE_INDEX
public static final String NAMESPACE_INDEX
- See Also:
- Constant Field Values
-
-
Method Detail
-
add
public void add(T obj)
Add objects
-
getIndexers
public Map<String,Function<T,List<String>>> getIndexers()
Returns the indexers registered with the cache.- Specified by:
getIndexersin interfaceIndexer<T>- Returns:
- registered indexers
-
addIndexers
public void addIndexers(Map<String,Function<T,List<String>>> indexersNew)
Description copied from interface:IndexerAdd additional indexers to the store.- Specified by:
addIndexersin interfaceIndexer<T>- Parameters:
indexersNew- indexers to add
-
update
public void update(T obj)
Update the object.
-
delete
public void delete(T obj)
Delete the object.
-
replace
public void replace(List<T> list, String resourceVersion)
Replace the content in the cache completely.
-
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
public void updateIndices(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- Parameters:
oldObj- old objectnewObj- new objectkey- the key
-
addIndexFunc
public void addIndexFunc(String indexName, Function<T,List<String>> indexFunc)
Add index func.- Parameters:
indexName- the index nameindexFunc- the index func
-
deletionHandlingMetaNamespaceKeyFunc
public static <T> String deletionHandlingMetaNamespaceKeyFunc(T object)
Checks for DeletedFinalStateUnknown objects before calling metaNamespaceKeyFunc- Type Parameters:
T- object type- Parameters:
object- the specific object- Returns:
- the key
-
metaNamespaceKeyFunc
public static String metaNamespaceKeyFunc(Object obj)
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
-
namespaceKeyFunc
public static String namespaceKeyFunc(String objectNamespace, String objectName)
Default index function that indexes based on an object's namespace and name.- See Also:
metaNamespaceKeyFunc(java.lang.Object)
-
-