Interface SharedInformer<ApiType extends io.kubernetes.client.common.KubernetesObject>

All Known Subinterfaces:
SharedIndexInformer<ApiType>
All Known Implementing Classes:
DefaultSharedIndexInformer

public interface SharedInformer<ApiType extends io.kubernetes.client.common.KubernetesObject>
  • Method Details

    • addEventHandler

      void addEventHandler(ResourceEventHandler<ApiType> handler)
      Add event handler.
      Parameters:
      handler - the handler
    • addEventHandlerWithResyncPeriod

      void addEventHandlerWithResyncPeriod(ResourceEventHandler<ApiType> handler, long resyncPeriod)
      addEventHandlerWithResyncPeriod 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.
      Parameters:
      handler - the event handler
      resyncPeriod - the specific resync period
    • run

      void run()
      run starts the shared informer, which will be stopped until stop() is called.
    • stop

      void stop()
      stop stops the shared informer.
    • hasSynced

      boolean hasSynced()
      hasSynced returns true if the shared informer's store has synced.
    • lastSyncResourceVersion

      String lastSyncResourceVersion()
      Last sync resource version string.
      Returns:
      the string
    • setTransform

      void setTransform(TransformFunc transformFunc)
      The TransformFunc is called for each object which is about to be stored. This function is intended for you to take the opportunity to remove, transform, or normalize fields. One use case is to strip unused metadata fields out of objects to save on RAM cost.

      Must be set before starting the informer.

      Note: Since the object given to the handler may be already shared with other goroutines, it is advisable to copy the object being transform before mutating it at all and returning the copy to prevent data races.

      Parameters:
      transformFunc - the transform function