Class Cache<T>
- java.lang.Object
-
- io.fabric8.kubernetes.client.informers.cache.Cache<T>
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAMESPACE_INDEX
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(T obj)
Add objectsvoid
addIndexers(Map<String,Function<T,List<String>>> indexersNew)
Add additional indexers to the store.void
addIndexFunc(String indexName, Function<T,List<String>> indexFunc)
Add index func.List<T>
byIndex(String indexName, String indexKey)
By index listvoid
delete(T obj)
Delete the object.static <T> String
deletionHandlingMetaNamespaceKeyFunc(T object)
Checks for DeletedFinalStateUnknown objects before calling metaNamespaceKeyFuncT
get(T obj)
Get objectT
getByKey(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 listvoid
isPopulated(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 String
metaNamespaceKeyFunc(Object obj)
It's is a convenient default KeyFunc which know show to make keys for API objects which implement HasMetadata interface.static String
namespaceKeyFunc(String objectNamespace, String objectName)
Default index function that indexes based on an object's namespace and name.void
replace(List<T> list, String resourceVersion)
Replace the content in the cache completely.void
resync()
Resyncvoid
update(T obj)
Update the object.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
-
-
-
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:
getIndexers
in interfaceIndexer<T>
- Returns:
- registered indexers
-
addIndexers
public void addIndexers(Map<String,Function<T,List<String>>> indexersNew)
Description copied from interface:Indexer
Add additional indexers to the store.- Specified by:
addIndexers
in 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:Store
Updates the status of cache in case of any API error from Kubernetes server- Specified by:
isPopulated
in 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)
-
-