Class ClusterEntrypoint

  • All Implemented Interfaces:
    AutoCloseable, org.apache.flink.runtime.rpc.FatalErrorHandler, org.apache.flink.util.AutoCloseableAsync
    Direct Known Subclasses:
    SessionClusterEntrypoint

    public abstract class ClusterEntrypoint
    extends Object
    implements org.apache.flink.util.AutoCloseableAsync, org.apache.flink.runtime.rpc.FatalErrorHandler
    Base class for the Flink cluster entry points.

    Specialization of this class can be used for the session mode and the per-job mode

    • Field Detail

      • INTERNAL_CLUSTER_EXECUTION_MODE

        @Internal
        public static final org.apache.flink.configuration.ConfigOption<String> INTERNAL_CLUSTER_EXECUTION_MODE
      • LOG

        protected static final org.slf4j.Logger LOG
      • STARTUP_FAILURE_RETURN_CODE

        protected static final int STARTUP_FAILURE_RETURN_CODE
        See Also:
        Constant Field Values
      • RUNTIME_FAILURE_RETURN_CODE

        protected static final int RUNTIME_FAILURE_RETURN_CODE
        See Also:
        Constant Field Values
    • Constructor Detail

      • ClusterEntrypoint

        protected ClusterEntrypoint​(org.apache.flink.configuration.Configuration configuration)
    • Method Detail

      • getRestPort

        public int getRestPort()
      • getRpcPort

        public int getRpcPort()
      • supportsReactiveMode

        protected boolean supportsReactiveMode()
      • installSecurityContext

        public static SecurityContext installSecurityContext​(org.apache.flink.configuration.Configuration configuration)
                                                      throws Exception
        Throws:
        Exception
      • initializeServices

        protected void initializeServices​(org.apache.flink.configuration.Configuration configuration,
                                          org.apache.flink.core.plugin.PluginManager pluginManager)
                                   throws Exception
        Throws:
        Exception
      • getRPCPortRange

        protected String getRPCPortRange​(org.apache.flink.configuration.Configuration configuration)
        Returns the port range for the common RpcService.
        Parameters:
        configuration - to extract the port range from
        Returns:
        Port range for the common RpcService
      • createHaServices

        protected HighAvailabilityServices createHaServices​(org.apache.flink.configuration.Configuration configuration,
                                                            Executor executor,
                                                            org.apache.flink.runtime.rpc.RpcSystemUtils rpcSystemUtils)
                                                     throws Exception
        Throws:
        Exception
      • createHeartbeatServices

        protected HeartbeatServices createHeartbeatServices​(org.apache.flink.configuration.Configuration configuration)
      • createMetricRegistry

        protected MetricRegistryImpl createMetricRegistry​(org.apache.flink.configuration.Configuration configuration,
                                                          org.apache.flink.core.plugin.PluginManager pluginManager,
                                                          org.apache.flink.runtime.rpc.RpcSystemUtils rpcSystemUtils)
      • closeAsync

        public CompletableFuture<Void> closeAsync()
        Specified by:
        closeAsync in interface org.apache.flink.util.AutoCloseableAsync
      • onFatalError

        public void onFatalError​(Throwable exception)
        Specified by:
        onFatalError in interface org.apache.flink.runtime.rpc.FatalErrorHandler
      • createSerializableExecutionGraphStore

        protected abstract ExecutionGraphInfoStore createSerializableExecutionGraphStore​(org.apache.flink.configuration.Configuration configuration,
                                                                                         org.apache.flink.util.concurrent.ScheduledExecutor scheduledExecutor)
                                                                                  throws IOException
        Throws:
        IOException
      • loadConfiguration

        protected static org.apache.flink.configuration.Configuration loadConfiguration​(EntrypointClusterConfiguration entrypointClusterConfiguration)
      • runClusterEntrypoint

        public static void runClusterEntrypoint​(ClusterEntrypoint clusterEntrypoint)