public class ReducedStateItemStore<V extends io.fabric8.kubernetes.api.model.HasMetadata> extends Object implements ItemStore<V>
| Modifier and Type | Class and Description |
|---|---|
static class |
ReducedStateItemStore.KeyState |
| Modifier and Type | Field and Description |
|---|---|
static ReducedStateItemStore.KeyState |
NAME_KEY_STATE |
static ReducedStateItemStore.KeyState |
UID_KEY_STATE |
| Constructor and Description |
|---|
ReducedStateItemStore(ReducedStateItemStore.KeyState keyState,
Class<V> typeClass,
KubernetesSerialization serialization,
String... valueFields)
Create a state store with only the fields specified.
|
| Modifier and Type | Method and Description |
|---|---|
V |
get(String key) |
String |
getKey(V obj) |
String |
getResourceVersion(String key) |
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() |
public static final ReducedStateItemStore.KeyState NAME_KEY_STATE
public static final ReducedStateItemStore.KeyState UID_KEY_STATE
public ReducedStateItemStore(ReducedStateItemStore.KeyState keyState, Class<V> typeClass, KubernetesSerialization serialization, String... valueFields)
metadata.resourceVersion - will automatically be saved as will the necessary key fields.
If you are using custom indexers, then the fields used by those indexes must be added to the valueFields - otherwise the indexer won't be able to delete the index entries when the item is removed.
For example in level event handling systems all you may need beyond the key is the ownerReferences. You would use withValueFields("metadata.ownerReferences") for that.
NOTE: If you use this feature, you should only use the informer cache/store for basic existence checks and maintain your own cache of full resource objects.
Only simple names are allowed in field paths - '.' is reserved as the separator.
Whatever is provided as the ReducedStateItemStore.KeyState should match the keyFunction provided to the informer.
keyState - information about the key fields/functiontypeClass - the expected typevalueFields - the additional fields to savepublic int size()
public boolean isFullState()
ItemStoreisFullState in interface ItemStore<V extends io.fabric8.kubernetes.api.model.HasMetadata>Copyright © 2015–2024 Red Hat. All rights reserved.