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 Details

    • index

      List<T> index​(String indexName, T obj)
      Retrieve list of obejcts that match on the named indexing function.
      Parameters:
      indexName - specific indexing function
      obj - 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 function
      indexKey - 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 function
      indexKey - 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