kubernetes/staging/src/k8s.io/apiserver/pkg/storage/cacher/store_btree.go

// newThreadedBtreeStoreIndexer returns a storage for cacher by adding locking over the two 2 data structures:
// * btree based storage for efficient LIST operation on prefix
// * map based indexer for retrieving values by index.
// This separation is used to allow independent snapshotting those two storages in the future.
// Intention is to utilize btree for its cheap snapshots that don't require locking if don't mutate data.
func newThreadedBtreeStoreIndexer(indexers cache.Indexers, degree int) *threadedStoreIndexer {}

type threadedStoreIndexer

func (si *threadedStoreIndexer) Add(obj interface{}

func (si *threadedStoreIndexer) Update(obj interface{}

func (si *threadedStoreIndexer) addOrUpdate(obj interface{}

func (si *threadedStoreIndexer) Delete(obj interface{}

func (si *threadedStoreIndexer) List() []interface{}

func (si *threadedStoreIndexer) ListPrefix(prefix, continueKey string, limit int) ([]interface{}

func (si *threadedStoreIndexer) ListKeys() []string {}

func (si *threadedStoreIndexer) Get(obj interface{}

func (si *threadedStoreIndexer) GetByKey(key string) (item interface{}

func (si *threadedStoreIndexer) Replace(objs []interface{}

func (si *threadedStoreIndexer) ByIndex(indexName, indexValue string) ([]interface{}

func newBtreeStore(degree int) btreeStore {}

type btreeStore

func (s *btreeStore) Add(obj interface{}

func (s *btreeStore) Update(obj interface{}

func (s *btreeStore) Delete(obj interface{}

func (s *btreeStore) deleteElem(storeElem *storeElement) interface{}

func (s *btreeStore) List() []interface{}

func (s *btreeStore) ListKeys() []string {}

func (s *btreeStore) Get(obj interface{}

func (s *btreeStore) GetByKey(key string) (item interface{}

func (s *btreeStore) Replace(objs []interface{}

// addOrUpdateLocked assumes a lock is held and is used for Add
// and Update operations.
func (s *btreeStore) addOrUpdateElem(storeElem *storeElement) *storeElement {}

func (s *btreeStore) getByKey(key string) (item interface{}

func (s *btreeStore) ListPrefix(prefix, continueKey string, limit int) ([]interface{}

func (s *btreeStore) Count(prefix, continueKey string) (count int) {}

// newIndexer returns a indexer similar to storeIndex from client-go/tools/cache.
// TODO: Unify the indexer code with client-go/cache package.
// Major differences is type of values stored and their mutability:
// * Indexer in client-go stores object keys, that are not mutable.
// * Indexer in cacher stores whole objects, which is mutable.
// Indexer in client-go uses keys as it is used in conjunction with map[key]value
// allowing for fast value retrieval, while btree used in cacher would provide additional overhead.
// Difference in mutability of stored values is used for optimizing some operations in client-go Indexer.
func newIndexer(indexers cache.Indexers) indexer {}

type indexer

func (i *indexer) ByIndex(indexName, indexValue string) ([]interface{}

func (i *indexer) Replace(objs []interface{}

func (i *indexer) updateElem(key string, oldObj, newObj *storeElement) (err error) {}

func (i *indexer) add(key, value string, obj *storeElement, index map[string]map[string]*storeElement) {}

func (i *indexer) delete(key, value string, index map[string]map[string]*storeElement) {}