Class Cache<ApiType extends KubernetesObject>
java.lang.Object
io.micronaut.kubernetes.client.openapi.informer.cache.Cache<ApiType>
- Type Parameters:
ApiType
- kubernetes api type
@Internal
public final class Cache<ApiType extends KubernetesObject>
extends Object
implements Indexer<ApiType>
Cache is a java port of k/client-go's ThreadSafeStore. It basically saves and indexes all the entries.
The code has been copied from the official client and modified: Cache
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Inserts an item into the store.Returns a list of objects by index name and index key.void
Removes an item from the store.Returns the request item with specific key.Return the indexers registered with the store.Returns a function which creates an object key.Returns a list of object keys by index name and index key.list()
Returns a list of all the items.listKeys()
Returns a list of keys of all objects that are currently in the store.void
Replace the content in the cache completely.void
Sets an item in the store to its updated state.
-
Field Details
-
DEFAULT_INDEX_NAME
- See Also:
-
DEFAULT_GLOBAL_INDEX_KEY
- See Also:
-
-
Constructor Details
-
Cache
public Cache() -
Cache
-
Cache
-
Cache
-
-
Method Details
-
getKeyFunction
Description copied from interface:Store
Returns a function which creates an object key.- Specified by:
getKeyFunction
in interfaceStore<ApiType extends KubernetesObject>
- Returns:
- function which creates an object key
-
add
Description copied from interface:Store
Inserts an item into the store.- Specified by:
add
in interfaceStore<ApiType extends KubernetesObject>
- Parameters:
object
- specific obj
-
update
Description copied from interface:Store
Sets an item in the store to its updated state.- Specified by:
update
in interfaceStore<ApiType extends KubernetesObject>
- Parameters:
object
- specific obj
-
delete
Description copied from interface:Store
Removes an item from the store.- Specified by:
delete
in interfaceStore<ApiType extends KubernetesObject>
- Parameters:
object
- specific obj
-
replace
Description copied from interface:Store
Replace the content in the cache completely.- Specified by:
replace
in interfaceStore<ApiType extends KubernetesObject>
- Parameters:
objects
- list of kubernetes objects
-
listKeys
Description copied from interface:Store
Returns a list of keys of all objects that are currently in the store.- Specified by:
listKeys
in interfaceStore<ApiType extends KubernetesObject>
- Returns:
- list of all keys
-
list
Description copied from interface:Store
Returns a list of all the items.- Specified by:
list
in interfaceStore<ApiType extends KubernetesObject>
- Returns:
- list of all the items
-
getByKey
Description copied from interface:Store
Returns the request item with specific key.- Specified by:
getByKey
in interfaceStore<ApiType extends KubernetesObject>
- Parameters:
key
- specific key- Returns:
- the request item
-
indexKeys
Description copied from interface:Indexer
Returns a list of object keys by index name and index key.- Specified by:
indexKeys
in interfaceIndexer<ApiType extends KubernetesObject>
- Parameters:
indexName
- the index nameindexKey
- the index key- Returns:
- the list of kubernetes object keys
-
byIndex
Description copied from interface:Indexer
Returns a list of objects by index name and index key.- Specified by:
byIndex
in interfaceIndexer<ApiType extends KubernetesObject>
- Parameters:
indexName
- the index nameindexKey
- the index key- Returns:
- the list of kubernetes objects
-
getIndexers
Description copied from interface:Indexer
Return the indexers registered with the store.- Specified by:
getIndexers
in interfaceIndexer<ApiType extends KubernetesObject>
- Returns:
- registered indexers
-