类 KubernetesRuntime

  • 所有已实现的接口:
    Runtime

    public class KubernetesRuntime
    extends java.lang.Object
    implements Runtime
    Kubernetes based runtime for running functions. This runtime provides the usual methods to start/stop/getfunctionstatus interfaces to control the kubernetes job running function. We first create a headless service and then a statefulset for starting function pods Each function instance runs as a pod itself. The reason using statefulset as opposed to a regular deployment is that functions require a unique instance_id for each instance. The service abstraction is used for getting functionstatus.
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static java.util.regex.Pattern VALID_POD_NAME_REGEX  
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      static java.lang.String createJobName​(org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails, java.lang.String jobName)  
      void deleteService()  
      void deleteStatefulSet()  
      static void doChecks​(org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails, java.lang.String overridenJobName)  
      java.util.concurrent.CompletableFuture<org.apache.pulsar.functions.proto.InstanceCommunication.MetricsData> getAndResetMetrics()  
      java.lang.Throwable getDeathException()  
      protected java.util.List<java.lang.String> getExecutorCommand()  
      java.util.concurrent.CompletableFuture<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus> getFunctionStatus​(int instanceId)  
      java.util.concurrent.CompletableFuture<org.apache.pulsar.functions.proto.InstanceCommunication.MetricsData> getMetrics​(int instanceId)  
      java.lang.String getPrometheusMetrics()  
      boolean isAlive()  
      void join()  
      void reinitialize()  
      java.util.concurrent.CompletableFuture<java.lang.Void> resetMetrics()  
      void start()
      The core logic that creates a service first followed by statefulset.
      void stop()  
      • 从类继承的方法 java.lang.Object

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

      • VALID_POD_NAME_REGEX

        public static final java.util.regex.Pattern VALID_POD_NAME_REGEX
    • 方法详细资料

      • start

        public void start()
                   throws java.lang.Exception
        The core logic that creates a service first followed by statefulset.
        指定者:
        start 在接口中 Runtime
        抛出:
        java.lang.Exception
      • join

        public void join()
                  throws java.lang.Exception
        指定者:
        join 在接口中 Runtime
        抛出:
        java.lang.Exception
      • stop

        public void stop()
                  throws java.lang.Exception
        指定者:
        stop 在接口中 Runtime
        抛出:
        java.lang.Exception
      • getDeathException

        public java.lang.Throwable getDeathException()
        指定者:
        getDeathException 在接口中 Runtime
      • getFunctionStatus

        public java.util.concurrent.CompletableFuture<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus> getFunctionStatus​(int instanceId)
        指定者:
        getFunctionStatus 在接口中 Runtime
      • getAndResetMetrics

        public java.util.concurrent.CompletableFuture<org.apache.pulsar.functions.proto.InstanceCommunication.MetricsData> getAndResetMetrics()
        指定者:
        getAndResetMetrics 在接口中 Runtime
      • resetMetrics

        public java.util.concurrent.CompletableFuture<java.lang.Void> resetMetrics()
        指定者:
        resetMetrics 在接口中 Runtime
      • getMetrics

        public java.util.concurrent.CompletableFuture<org.apache.pulsar.functions.proto.InstanceCommunication.MetricsData> getMetrics​(int instanceId)
        指定者:
        getMetrics 在接口中 Runtime
      • getPrometheusMetrics

        public java.lang.String getPrometheusMetrics()
                                              throws java.io.IOException
        指定者:
        getPrometheusMetrics 在接口中 Runtime
        抛出:
        java.io.IOException
      • isAlive

        public boolean isAlive()
        指定者:
        isAlive 在接口中 Runtime
      • deleteStatefulSet

        public void deleteStatefulSet()
                               throws java.lang.InterruptedException
        抛出:
        java.lang.InterruptedException
      • deleteService

        public void deleteService()
                           throws java.lang.InterruptedException
        抛出:
        java.lang.InterruptedException
      • getExecutorCommand

        protected java.util.List<java.lang.String> getExecutorCommand()
      • createJobName

        public static java.lang.String createJobName​(org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails,
                                                     java.lang.String jobName)
      • doChecks

        public static void doChecks​(org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails,
                                    java.lang.String overridenJobName)