V - public interface ItemStore<V>
SharedIndexInformer. For events to be consistent the store should remember
all entries until they are deleted. At its simplest this is just a map coupled with a key function.
Modifications to this store once the informer is running, by anything other than the informer will alter the event stream. If
for example an item is not found, an subsequent update from the api version will send notifications to
ResourceEventHandlers as an add.
Direct modifications to this store by anything other than the informer will not updated indexes nor emit events.
The implementation should be safe with respect to concurrency. Modifications from the informer will be single threaded, but not necessarily the same thread. Reads may be concurrent with writes.
See an example implementations BasicItemStore and ReducedStateItemStore
| Modifier and Type | Method and Description |
|---|---|
V |
get(String key) |
String |
getKey(V obj) |
default boolean |
isFullState()
Used to determine if initial add events can be deferred until
the entire list operation has completed - when using a limit
it may take several batches to complete.
|
Stream<String> |
keySet() |
V |
put(String key,
V obj) |
V |
remove(String key) |
int |
size() |
Stream<V> |
values() |
int size()
default boolean isFullState()
Copyright © 2015–2022 Red Hat. All rights reserved.