Class AbstractFlinkResourceObserver<CR extends AbstractFlinkResource<?,​?>,​CTX extends ObserverContext>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract CTX getObserverContext​(CR resource, io.javaoperatorsdk.operator.api.reconciler.Context<?> context)
      Get the observer context for the current resource.
      protected boolean isResourceReadyToBeObserved​(CR resource, io.javaoperatorsdk.operator.api.reconciler.Context<?> resourceContext, CTX observerContext)
      Check whether the resource should be observed.
      void observe​(CR resource, io.javaoperatorsdk.operator.api.reconciler.Context<?> context)
      Observe the flinkApp status, It will reflect the changed status on the flinkApp resource.
      protected abstract void observeInternal​(CR resource, io.javaoperatorsdk.operator.api.reconciler.Context<?> resourceContext, CTX observerContext)
      Internal observer logic specific to each resource type.
      protected abstract void updateStatusToDeployedIfAlreadyUpgraded​(CR resource, io.javaoperatorsdk.operator.api.reconciler.Context<?> resourceContext, CTX observerContext)
      Checks a resource that is currently in the UPGRADING state whether it was already deployed but we simply miss the status information.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Method Detail

      • observe

        public final void observe​(CR resource,
                                  io.javaoperatorsdk.operator.api.reconciler.Context<?> context)
        Description copied from interface: Observer
        Observe the flinkApp status, It will reflect the changed status on the flinkApp resource.
        Specified by:
        observe in interface Observer<CR extends AbstractFlinkResource<?,​?>>
        Parameters:
        resource - the target custom resource
        context - the context with which the operation is executed
      • getObserverContext

        protected abstract CTX getObserverContext​(CR resource,
                                                  io.javaoperatorsdk.operator.api.reconciler.Context<?> context)
        Get the observer context for the current resource.
        Parameters:
        resource - Resource being observed
        context - Resource context
        Returns:
        Observer context
      • isResourceReadyToBeObserved

        protected boolean isResourceReadyToBeObserved​(CR resource,
                                                      io.javaoperatorsdk.operator.api.reconciler.Context<?> resourceContext,
                                                      CTX observerContext)
        Check whether the resource should be observed. In certain states such as suspended applications or in-progress upgrades and rollbacks, observing is not necessary.
        Parameters:
        resource - Current resource
        resourceContext - Resource context
        observerContext - Observer context
        Returns:
        True if we should observe the resource
      • observeInternal

        protected abstract void observeInternal​(CR resource,
                                                io.javaoperatorsdk.operator.api.reconciler.Context<?> resourceContext,
                                                CTX observerContext)
        Internal observer logic specific to each resource type.
        Parameters:
        resource - Resource to be observed
        resourceContext - Resource context
        observerContext - Observer context
      • updateStatusToDeployedIfAlreadyUpgraded

        protected abstract void updateStatusToDeployedIfAlreadyUpgraded​(CR resource,
                                                                        io.javaoperatorsdk.operator.api.reconciler.Context<?> resourceContext,
                                                                        CTX observerContext)
        Checks a resource that is currently in the UPGRADING state whether it was already deployed but we simply miss the status information. After comparing the target resource generation with the one from the possible deployment if they match we update the status to the already DEPLOYED state.
        Parameters:
        resource - Flink resource.
        resourceContext - Context for resource.
        observerContext - Context for observer.