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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInserts an item into the store.Returns a list of objects by index name and index key.voidRemoves 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.voidReplace the content in the cache completely.voidSets 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:StoreReturns a function which creates an object key.- Specified by:
getKeyFunctionin interfaceStore<ApiType extends KubernetesObject>- Returns:
- function which creates an object key
-
add
Description copied from interface:StoreInserts an item into the store.- Specified by:
addin interfaceStore<ApiType extends KubernetesObject>- Parameters:
object- specific obj
-
update
Description copied from interface:StoreSets an item in the store to its updated state.- Specified by:
updatein interfaceStore<ApiType extends KubernetesObject>- Parameters:
object- specific obj
-
delete
Description copied from interface:StoreRemoves an item from the store.- Specified by:
deletein interfaceStore<ApiType extends KubernetesObject>- Parameters:
object- specific obj
-
replace
Description copied from interface:StoreReplace the content in the cache completely.- Specified by:
replacein interfaceStore<ApiType extends KubernetesObject>- Parameters:
objects- list of kubernetes objects
-
listKeys
Description copied from interface:StoreReturns a list of keys of all objects that are currently in the store.- Specified by:
listKeysin interfaceStore<ApiType extends KubernetesObject>- Returns:
- list of all keys
-
list
Description copied from interface:StoreReturns a list of all the items.- Specified by:
listin interfaceStore<ApiType extends KubernetesObject>- Returns:
- list of all the items
-
getByKey
Description copied from interface:StoreReturns the request item with specific key.- Specified by:
getByKeyin interfaceStore<ApiType extends KubernetesObject>- Parameters:
key- specific key- Returns:
- the request item
-
indexKeys
Description copied from interface:IndexerReturns a list of object keys by index name and index key.- Specified by:
indexKeysin interfaceIndexer<ApiType extends KubernetesObject>- Parameters:
indexName- the index nameindexKey- the index key- Returns:
- the list of kubernetes object keys
-
byIndex
Description copied from interface:IndexerReturns a list of objects by index name and index key.- Specified by:
byIndexin interfaceIndexer<ApiType extends KubernetesObject>- Parameters:
indexName- the index nameindexKey- the index key- Returns:
- the list of kubernetes objects
-
getIndexers
Description copied from interface:IndexerReturn the indexers registered with the store.- Specified by:
getIndexersin interfaceIndexer<ApiType extends KubernetesObject>- Returns:
- registered indexers
-