Interface Indexer<T>
- Type Parameters:
T- resource
- All Superinterfaces:
Store<T>
- All Known Implementing Classes:
Cache
public interface Indexer<T> extends Store<T>
Indexer extends Store interface and add index/de-index methods.
This implementation has been taken from official client: https://github.com/kubernetes-client/java/blob/master/util/src/main/java/io/kubernetes/client/informer/cache/Indexer.java
which has been ported from official go client: https://github.com/kubernetes/client-go/blob/master/tools/cache/index.go
-
Method Summary
Modifier and Type Method Description voidaddIndexers(Map<String,Function<T,List<String>>> indexers)Add additional indexers to the store.List<T>byIndex(String indexName, String indexKey)Lists objects that match on the named indexing function with the exact key.Map<String,Function<T,List<String>>>getIndexers()Return the indexers registered with the store.List<T>index(String indexName, T obj)Retrieve list of obejcts that match on the named indexing function.List<String>indexKeys(String indexName, String indexKey)Returns the set of keys that match on the named indexing function.
-
Method Details
-
index
Retrieve list of obejcts that match on the named indexing function.- Parameters:
indexName- specific indexing functionobj- object- Returns:
- matched objects
-
indexKeys
Returns the set of keys that match on the named indexing function.- Parameters:
indexName- specific indexing functionindexKey- specific index key- Returns:
- matched keys
-
byIndex
Lists objects that match on the named indexing function with the exact key.- Parameters:
indexName- specific indexing functionindexKey- specific index key- Returns:
- matched objects
-
getIndexers
Return the indexers registered with the store.- Returns:
- registered indexers
-
addIndexers
Add additional indexers to the store.- Parameters:
indexers- indexers to add
-