public abstract class ClusterEntrypoint extends Object implements 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> |
EXECUTION_MODE |
protected static org.slf4j.Logger |
LOG |
protected static int |
RUNTIME_FAILURE_RETURN_CODE |
protected static int |
STARTUP_FAILURE_RETURN_CODE |
protected static int |
SUCCESS_RETURN_CODE |
Modifier | Constructor and Description |
---|---|
protected |
ClusterEntrypoint(org.apache.flink.configuration.Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
protected void |
configureFileSystems(org.apache.flink.configuration.Configuration configuration) |
protected abstract Dispatcher |
createDispatcher(org.apache.flink.configuration.Configuration configuration,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
ResourceManagerGateway resourceManagerGateway,
BlobServer blobServer,
HeartbeatServices heartbeatServices,
JobManagerMetricGroup jobManagerMetricGroup,
String metricQueryServicePath,
ArchivedExecutionGraphStore archivedExecutionGraphStore,
FatalErrorHandler fatalErrorHandler,
String restAddress,
HistoryServerArchivist historyServerArchivist) |
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) |
protected abstract ResourceManager<?> |
createResourceManager(org.apache.flink.configuration.Configuration configuration,
ResourceID resourceId,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
HeartbeatServices heartbeatServices,
MetricRegistry metricRegistry,
FatalErrorHandler fatalErrorHandler,
ClusterInformation clusterInformation,
String webInterfaceUrl) |
protected abstract WebMonitorEndpoint<?> |
createRestEndpoint(org.apache.flink.configuration.Configuration configuration,
LeaderGatewayRetriever<DispatcherGateway> dispatcherGatewayRetriever,
LeaderGatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever,
TransientBlobService transientBlobService,
Executor executor,
MetricQueryServiceRetriever metricQueryServiceRetriever,
LeaderElectionService leaderElectionService) |
protected RpcService |
createRpcService(org.apache.flink.configuration.Configuration configuration,
String bindAddress,
String portRange) |
protected abstract ArchivedExecutionGraphStore |
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<Void> |
getTerminationFuture() |
protected void |
initializeServices(org.apache.flink.configuration.Configuration configuration) |
protected SecurityContext |
installSecurityContext(org.apache.flink.configuration.Configuration configuration) |
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) |
protected void |
runCluster(org.apache.flink.configuration.Configuration configuration) |
protected void |
shutDownAndTerminate(int returnCode,
ApplicationStatus applicationStatus,
String diagnostics,
boolean cleanupHaData) |
protected void |
startCluster() |
protected void |
startClusterComponents(org.apache.flink.configuration.Configuration configuration,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
BlobServer blobServer,
HeartbeatServices heartbeatServices,
MetricRegistry metricRegistry) |
protected CompletableFuture<Void> |
stopClusterComponents() |
protected CompletableFuture<Void> |
stopClusterServices(boolean cleanupHaData) |
public static final org.apache.flink.configuration.ConfigOption<String> EXECUTION_MODE
protected static final org.slf4j.Logger LOG
protected static final int SUCCESS_RETURN_CODE
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<Void> getTerminationFuture()
protected void startCluster()
protected void configureFileSystems(org.apache.flink.configuration.Configuration configuration) throws Exception
Exception
protected SecurityContext installSecurityContext(org.apache.flink.configuration.Configuration configuration) throws Exception
Exception
protected void runCluster(org.apache.flink.configuration.Configuration configuration) throws Exception
Exception
protected void initializeServices(org.apache.flink.configuration.Configuration configuration) throws Exception
Exception
protected void startClusterComponents(org.apache.flink.configuration.Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, BlobServer blobServer, HeartbeatServices heartbeatServices, MetricRegistry metricRegistry) throws Exception
Exception
protected String getRPCPortRange(org.apache.flink.configuration.Configuration configuration)
RpcService
.configuration
- to extract the port range fromRpcService
protected RpcService createRpcService(org.apache.flink.configuration.Configuration configuration, String bindAddress, String portRange) throws Exception
Exception
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)
protected CompletableFuture<Void> stopClusterServices(boolean cleanupHaData)
protected CompletableFuture<Void> stopClusterComponents()
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 shutDownAndTerminate(int returnCode, ApplicationStatus applicationStatus, @Nullable String diagnostics, boolean cleanupHaData)
protected abstract Dispatcher createDispatcher(org.apache.flink.configuration.Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, ResourceManagerGateway resourceManagerGateway, BlobServer blobServer, HeartbeatServices heartbeatServices, JobManagerMetricGroup jobManagerMetricGroup, @Nullable String metricQueryServicePath, ArchivedExecutionGraphStore archivedExecutionGraphStore, FatalErrorHandler fatalErrorHandler, @Nullable String restAddress, HistoryServerArchivist historyServerArchivist) throws Exception
Exception
protected abstract ResourceManager<?> createResourceManager(org.apache.flink.configuration.Configuration configuration, ResourceID resourceId, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, MetricRegistry metricRegistry, FatalErrorHandler fatalErrorHandler, ClusterInformation clusterInformation, @Nullable String webInterfaceUrl) throws Exception
Exception
protected abstract WebMonitorEndpoint<?> createRestEndpoint(org.apache.flink.configuration.Configuration configuration, LeaderGatewayRetriever<DispatcherGateway> dispatcherGatewayRetriever, LeaderGatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, TransientBlobService transientBlobService, Executor executor, MetricQueryServiceRetriever metricQueryServiceRetriever, LeaderElectionService leaderElectionService) throws Exception
Exception
protected abstract ArchivedExecutionGraphStore 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)
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.