Class DefaultSharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>
java.lang.Object
io.fabric8.kubernetes.client.informers.impl.DefaultSharedIndexInformer<T,L>
- All Implemented Interfaces:
SharedIndexInformer<T>,SharedInformer<T>
public class DefaultSharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>> extends Object implements SharedIndexInformer<T>
-
Constructor Summary
Constructors Constructor Description DefaultSharedIndexInformer(Class<T> apiTypeClass, ListerWatcher<T,L> listerWatcher, long resyncPeriod, OperationContext context, ConcurrentLinkedQueue<SharedInformerEventListener> eventListeners) -
Method Summary
Modifier and Type Method Description voidaddEventHandler(ResourceEventHandler<T> handler)add event callbackvoidaddEventHandlerWithResyncPeriod(ResourceEventHandler<T> handler, long resyncPeriodMillis)Adds an event handler to the shared informer using the specified resync period.voidaddIndexers(Map<String,Function<T,List<String>>> indexers)Add indexersIndexergetIndexer()returns the internal indexer store.booleanhasSynced()StringlastSyncResourceVersion()The resource version observed when last synced with the underlying store.voidrun()Starts the shared informer, which will be stopped until stop() is called.voidstop()Stops the shared informer.
-
Constructor Details
-
DefaultSharedIndexInformer
public DefaultSharedIndexInformer(Class<T> apiTypeClass, ListerWatcher<T,L> listerWatcher, long resyncPeriod, OperationContext context, ConcurrentLinkedQueue<SharedInformerEventListener> eventListeners)
-
-
Method Details
-
addEventHandler
add event callback- Specified by:
addEventHandlerin interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>- Parameters:
handler- event handler
-
addEventHandlerWithResyncPeriod
public void addEventHandlerWithResyncPeriod(ResourceEventHandler<T> handler, long resyncPeriodMillis)Description copied from interface:SharedInformerAdds an event handler to the shared informer using the specified resync period. Events to a single handler are delivered sequentially, but there is no coordination between different handlers.- Specified by:
addEventHandlerWithResyncPeriodin interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>- Parameters:
handler- the event handlerresyncPeriodMillis- the specific resync period
-
lastSyncResourceVersion
Description copied from interface:SharedInformerThe resource version observed when last synced with the underlying store. The value returned is not synchronized with access to the underlying store and is not thread-safe.- Specified by:
lastSyncResourceVersionin interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>- Returns:
- string value
-
run
public void run()Description copied from interface:SharedInformerStarts the shared informer, which will be stopped until stop() is called.- Specified by:
runin interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
-
stop
public void stop()Description copied from interface:SharedInformerStops the shared informer.- Specified by:
stopin interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
-
hasSynced
public boolean hasSynced()- Specified by:
hasSyncedin interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
-
addIndexers
Description copied from interface:SharedIndexInformerAdd indexers- Specified by:
addIndexersin interfaceSharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>- Parameters:
indexers- indexers
-
getIndexer
Description copied from interface:SharedIndexInformerreturns the internal indexer store.- Specified by:
getIndexerin interfaceSharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>- Returns:
- the internal indexer store
-