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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventHandler(ResourceEventHandler<T> handler)
add event callbackvoid
addEventHandlerWithResyncPeriod(ResourceEventHandler<T> handler, long resyncPeriodMillis)
Adds an event handler to the shared informer using the specified resync period.void
addIndexers(Map<String,Function<T,List<String>>> indexers)
Add indexersIndexer
getIndexer()
returns the internal indexer store.boolean
hasSynced()
String
lastSyncResourceVersion()
The resource version observed when last synced with the underlying store.void
run()
Starts the shared informer, which will be stopped until stop() is called.void
stop()
Stops the shared informer.
-
-
-
Constructor Detail
-
DefaultSharedIndexInformer
public DefaultSharedIndexInformer(Class<T> apiTypeClass, ListerWatcher<T,L> listerWatcher, long resyncPeriod, OperationContext context, ConcurrentLinkedQueue<SharedInformerEventListener> eventListeners)
-
-
Method Detail
-
addEventHandler
public void addEventHandler(ResourceEventHandler<T> handler)
add event callback- Specified by:
addEventHandler
in 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:SharedInformer
Adds 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:
addEventHandlerWithResyncPeriod
in interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
- Parameters:
handler
- the event handlerresyncPeriodMillis
- the specific resync period
-
lastSyncResourceVersion
public String lastSyncResourceVersion()
Description copied from interface:SharedInformer
The 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:
lastSyncResourceVersion
in interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
- Returns:
- string value
-
run
public void run()
Description copied from interface:SharedInformer
Starts the shared informer, which will be stopped until stop() is called.- Specified by:
run
in interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
-
stop
public void stop()
Description copied from interface:SharedInformer
Stops the shared informer.- Specified by:
stop
in interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
-
hasSynced
public boolean hasSynced()
- Specified by:
hasSynced
in interfaceSharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
-
addIndexers
public void addIndexers(Map<String,Function<T,List<String>>> indexers)
Description copied from interface:SharedIndexInformer
Add indexers- Specified by:
addIndexers
in interfaceSharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
- Parameters:
indexers
- indexers
-
getIndexer
public Indexer getIndexer()
Description copied from interface:SharedIndexInformer
returns the internal indexer store.- Specified by:
getIndexer
in interfaceSharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
- Returns:
- the internal indexer store
-
-