| Constructor and Description |
|---|
Cache() |
Cache(String indexName,
Function<ApiType,List<String>> indexFunc,
Function<ApiType,String> keyFunc)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(ApiType obj)
Add objects.
|
void |
addIndexers(Map<String,Function<ApiType,List<String>>> newIndexers)
Add additional indexers to the cache.
|
void |
addIndexFunc(String indexName,
Function<ApiType,List<String>> indexFunc)
Add index func.
|
List<ApiType> |
byIndex(String indexName,
String indexKey)
By index list.
|
void |
delete(ApiType obj)
Delete the object.
|
ApiType |
get(ApiType obj)
Get object t.
|
ApiType |
getByKey(String key)
Gets get by key.
|
Map<String,Function<ApiType,List<String>>> |
getIndexers()
Return the indexers registered with the cache.
|
Function<ApiType,String> |
getKeyFunc() |
List<ApiType> |
index(String indexName,
ApiType obj)
Get objects .
|
List<String> |
indexKeys(String indexName,
String indexKey)
Index keys list.
|
List<ApiType> |
list()
List all objects in the cache.
|
List<String> |
listKeys()
List keys.
|
void |
replace(List<ApiType> list,
String resourceVersion)
Replace the content in the cache completely.
|
void |
resync()
Resync.
|
void |
setKeyFunc(Function<ApiType,String> keyFunc) |
void |
update(ApiType obj)
Update the object.
|
void |
updateIndices(ApiType oldObj,
ApiType newObj,
String key)
updateIndices modifies the objects location in the managed indexes, if this is an update, you
must provide an oldObj.
|
public Cache()
public Cache(String indexName, Function<ApiType,List<String>> indexFunc, Function<ApiType,String> keyFunc)
indexName - the index name, an unique name representing the indexindexFunc - the index func by which we map multiple object to an index for queryingkeyFunc - the key func by which we map one object to an unique key for storingpublic void add(ApiType obj)
public void update(ApiType obj)
public void delete(ApiType obj)
public void replace(List<ApiType> list, String resourceVersion)
public void resync()
public Map<String,Function<ApiType,List<String>>> getIndexers()
getIndexers in interface Indexer<ApiType extends io.kubernetes.client.common.KubernetesObject>public void addIndexers(Map<String,Function<ApiType,List<String>>> newIndexers)
addIndexers in interface Indexer<ApiType extends io.kubernetes.client.common.KubernetesObject>newIndexers - indexers to addpublic void updateIndices(ApiType oldObj, ApiType newObj, String key)
Note: updateIndices must be called from a function that already has a lock on the cache.
oldObj - the old objnewObj - the new objkey - the keypublic void addIndexFunc(String indexName, Function<ApiType,List<String>> indexFunc)
indexName - the index nameindexFunc - the index funcCopyright © 2022. All rights reserved.