public abstract class ClusterEntrypoint extends Object implements org.apache.flink.util.AutoCloseableAsync, FatalErrorHandler
Specialization of this class can be used for the session mode and the per-job mode
Modifier and Type | Class and Description |
---|---|
static class |
ClusterEntrypoint.ExecutionMode
Execution mode of the
MiniDispatcher . |
Modifier and Type | Field and Description |
---|---|
static org.apache.flink.configuration.ConfigOption<String> |
INTERNAL_CLUSTER_EXECUTION_MODE |
protected static org.slf4j.Logger |
LOG |
protected static int |
RUNTIME_FAILURE_RETURN_CODE |
protected static int |
STARTUP_FAILURE_RETURN_CODE |
Modifier | Constructor and Description |
---|---|
protected |
ClusterEntrypoint(org.apache.flink.configuration.Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupDirectories()
Clean up of temporary directories created by the
ClusterEntrypoint . |
CompletableFuture<Void> |
closeAsync() |
protected abstract DispatcherResourceManagerComponentFactory |
createDispatcherResourceManagerComponentFactory(org.apache.flink.configuration.Configuration configuration) |
protected HighAvailabilityServices |
createHaServices(org.apache.flink.configuration.Configuration configuration,
Executor executor) |
protected HeartbeatServices |
createHeartbeatServices(org.apache.flink.configuration.Configuration configuration) |
protected MetricRegistryImpl |
createMetricRegistry(org.apache.flink.configuration.Configuration configuration,
org.apache.flink.core.plugin.PluginManager pluginManager) |
protected abstract ExecutionGraphInfoStore |
createSerializableExecutionGraphStore(org.apache.flink.configuration.Configuration configuration,
ScheduledExecutor scheduledExecutor) |
protected String |
getRPCPortRange(org.apache.flink.configuration.Configuration configuration)
Returns the port range for the common
RpcService . |
CompletableFuture<ApplicationStatus> |
getTerminationFuture() |
protected void |
initializeServices(org.apache.flink.configuration.Configuration configuration,
org.apache.flink.core.plugin.PluginManager pluginManager) |
protected static org.apache.flink.configuration.Configuration |
loadConfiguration(EntrypointClusterConfiguration entrypointClusterConfiguration) |
void |
onFatalError(Throwable exception)
Being called when a fatal error occurs.
|
protected static EntrypointClusterConfiguration |
parseArguments(String[] args) |
static void |
runClusterEntrypoint(ClusterEntrypoint clusterEntrypoint) |
void |
startCluster() |
protected CompletableFuture<Void> |
stopClusterServices(boolean cleanupHaData) |
protected boolean |
supportsReactiveMode() |
public static final org.apache.flink.configuration.ConfigOption<String> INTERNAL_CLUSTER_EXECUTION_MODE
protected static final org.slf4j.Logger LOG
protected static final int STARTUP_FAILURE_RETURN_CODE
protected static final int RUNTIME_FAILURE_RETURN_CODE
protected ClusterEntrypoint(org.apache.flink.configuration.Configuration configuration)
public CompletableFuture<ApplicationStatus> getTerminationFuture()
public void startCluster() throws ClusterEntrypointException
ClusterEntrypointException
protected boolean supportsReactiveMode()
protected void initializeServices(org.apache.flink.configuration.Configuration configuration, org.apache.flink.core.plugin.PluginManager pluginManager) throws Exception
Exception
protected String getRPCPortRange(org.apache.flink.configuration.Configuration configuration)
RpcService
.configuration
- to extract the port range fromRpcService
protected HighAvailabilityServices createHaServices(org.apache.flink.configuration.Configuration configuration, Executor executor) throws Exception
Exception
protected HeartbeatServices createHeartbeatServices(org.apache.flink.configuration.Configuration configuration)
protected MetricRegistryImpl createMetricRegistry(org.apache.flink.configuration.Configuration configuration, org.apache.flink.core.plugin.PluginManager pluginManager)
public CompletableFuture<Void> closeAsync()
closeAsync
in interface org.apache.flink.util.AutoCloseableAsync
protected CompletableFuture<Void> stopClusterServices(boolean cleanupHaData)
public void onFatalError(Throwable exception)
FatalErrorHandler
IMPORTANT: This call should never be blocking since it might be called from within the
main thread of an RpcEndpoint
.
onFatalError
in interface FatalErrorHandler
exception
- causeprotected void cleanupDirectories() throws IOException
ClusterEntrypoint
.IOException
- if the temporary directories could not be cleaned upprotected abstract DispatcherResourceManagerComponentFactory createDispatcherResourceManagerComponentFactory(org.apache.flink.configuration.Configuration configuration) throws IOException
IOException
protected abstract ExecutionGraphInfoStore createSerializableExecutionGraphStore(org.apache.flink.configuration.Configuration configuration, ScheduledExecutor scheduledExecutor) throws IOException
IOException
protected static EntrypointClusterConfiguration parseArguments(String[] args) throws FlinkParseException
FlinkParseException
protected static org.apache.flink.configuration.Configuration loadConfiguration(EntrypointClusterConfiguration entrypointClusterConfiguration)
public static void runClusterEntrypoint(ClusterEntrypoint clusterEntrypoint)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.