类 StatusRecorder<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<?,​STATUS>,​STATUS extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<?>>


  • public class StatusRecorder<CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<?,​STATUS>,​STATUS extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<?>>
    extends java.lang.Object
    Helper class for status management and updates.
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      protected com.fasterxml.jackson.databind.ObjectMapper objectMapper  
      protected java.util.concurrent.ConcurrentHashMap<io.javaoperatorsdk.operator.processing.event.ResourceID,​com.fasterxml.jackson.databind.node.ObjectNode> statusCache  
    • 构造器概要

      构造器 
      构造器 说明
      StatusRecorder​(io.fabric8.kubernetes.client.KubernetesClient client, MetricManager<CR> metricManager, java.util.function.BiConsumer<CR,​STATUS> statusUpdateListener)  
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      static <S extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<?>,​CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<?,​S>>
      StatusRecorder<CR,​S>
      create​(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, MetricManager<CR> metricManager, java.util.Collection<org.apache.flink.kubernetes.operator.api.listener.FlinkResourceListener> listeners)  
      void patchAndCacheStatus​(CR resource)
      Update the status of the provided kubernetes resource on the k8s cluster.
      void removeCachedStatus​(CR resource)
      Remove cached status for Flink resource.
      void updateStatusFromCache​(CR resource)
      Update the custom resource status based on the in-memory cached to ensure that any status updates that we made previously are always visible in the reconciliation loop.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • objectMapper

        protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
      • statusCache

        protected final java.util.concurrent.ConcurrentHashMap<io.javaoperatorsdk.operator.processing.event.ResourceID,​com.fasterxml.jackson.databind.node.ObjectNode> statusCache
    • 构造器详细资料

      • StatusRecorder

        public StatusRecorder​(io.fabric8.kubernetes.client.KubernetesClient client,
                              MetricManager<CR> metricManager,
                              java.util.function.BiConsumer<CR,​STATUS> statusUpdateListener)
    • 方法详细资料

      • patchAndCacheStatus

        public void patchAndCacheStatus​(CR resource)
        Update the status of the provided kubernetes resource on the k8s cluster. We use patch together with null resourceVersion to try to guarantee that the status update succeeds even if the underlying resource spec was update in the meantime. This is necessary for the correct operator behavior.
        参数:
        resource - Resource for which status update should be performed
      • updateStatusFromCache

        public void updateStatusFromCache​(CR resource)
        Update the custom resource status based on the in-memory cached to ensure that any status updates that we made previously are always visible in the reconciliation loop. This is required due to our custom status patching logic.

        If the cache doesn't have a status stored, we do no update. This happens when the operator reconciles a resource for the first time after a restart.

        参数:
        resource - Resource for which the status should be updated from the cache
      • removeCachedStatus

        public void removeCachedStatus​(CR resource)
        Remove cached status for Flink resource.
        参数:
        resource - Flink resource.
      • create

        public static <S extends org.apache.flink.kubernetes.operator.api.status.CommonStatus<?>,​CR extends org.apache.flink.kubernetes.operator.api.AbstractFlinkResource<?,​S>> StatusRecorder<CR,​S> create​(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient,
                                                                                                                                                                                                                               MetricManager<CR> metricManager,
                                                                                                                                                                                                                               java.util.Collection<org.apache.flink.kubernetes.operator.api.listener.FlinkResourceListener> listeners)