Interface Indexer<T>
-
- Type Parameters:
T- resource
- All Superinterfaces:
Store<T>
- All Known Subinterfaces:
Cache<T>
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/main/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
All Methods Instance Methods Abstract Methods 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 objects 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.voidremoveIndexer(String name)Remove the named index
-
-
-
Method Detail
-
index
List<T> index(String indexName, T obj)
Retrieve list of objects that match on the named indexing function.- Parameters:
indexName- specific indexing functionobj- object- Returns:
- matched objects
-
indexKeys
List<String> indexKeys(String indexName, String indexKey)
Returns the set of keys that match on the named indexing function.- Parameters:
indexName- specific indexing functionindexKey- specific index key- Returns:
- matched keys
-
byIndex
List<T> byIndex(String indexName, String indexKey)
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
Map<String,Function<T,List<String>>> getIndexers()
Return the indexers registered with the store.- Returns:
- registered indexers
-
addIndexers
void addIndexers(Map<String,Function<T,List<String>>> indexers)
Add additional indexers to the store.- Parameters:
indexers- indexers to add
-
removeIndexer
void removeIndexer(String name)
Remove the named index- Parameters:
name-
-
-