Class ProcessorStore<T extends HasMetadata>
- java.lang.Object
-
- io.fabric8.kubernetes.client.informers.impl.cache.ProcessorStore<T>
-
public class ProcessorStore<T extends HasMetadata> extends Object
Wraps aCacheand aSharedProcessorto distribute events related to changes and syncs
-
-
Constructor Summary
Constructors Constructor Description ProcessorStore(CacheImpl<T> cache, SharedProcessor<T> processor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(T obj)voiddelete(T obj)Tget(T object)TgetByKey(String key)StringgetKey(T obj)List<T>list()List<String>listKeys()ExecutoronList(String resourceVersion, boolean remainedEmpty)Distributes the onList event to all registered handlers and returns the serial executor used for event processing.voidresync()booleansyncList(Set<String> nextKeys)Syncs the cache with the given set of keys from the latest list operation.voidupdate(List<T> items)voidupdate(T obj)
-
-
-
Constructor Detail
-
ProcessorStore
public ProcessorStore(CacheImpl<T> cache, SharedProcessor<T> processor)
-
-
Method Detail
-
add
public void add(T obj)
-
update
public void update(T obj)
-
delete
public void delete(T obj)
-
syncList
public boolean syncList(Set<String> nextKeys)
Syncs the cache with the given set of keys from the latest list operation. Emits deferred add notifications if this is the first sync, and emits delete notifications for any cached items whose keys are not innextKeys.- Parameters:
nextKeys- the set of keys from the latest list result- Returns:
trueif the cache was empty before processing deletions,falseotherwise
-
onList
public Executor onList(String resourceVersion, boolean remainedEmpty)
Distributes the onList event to all registered handlers and returns the serial executor used for event processing. Callers can use the returned executor to schedule work that must run after all handler notifications have been processed.- Parameters:
resourceVersion- the latest resource version known to the list operationremainedEmpty-trueif the cache was empty both before and after the list operation- Returns:
- the serial executor that processes handler notifications
-
resync
public void resync()
-
-