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 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(Configuration configuration) |
public static final 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(Configuration configuration)
public CompletableFuture<Void> getTerminationFuture()
protected void startCluster()
protected void configureFileSystems(Configuration configuration) throws Exception
Exception
protected SecurityContext installSecurityContext(Configuration configuration) throws Exception
Exception
protected void runCluster(Configuration configuration) throws Exception
Exception
protected void initializeServices(Configuration configuration) throws Exception
Exception
protected void startClusterComponents(Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, BlobServer blobServer, HeartbeatServices heartbeatServices, MetricRegistry metricRegistry) throws Exception
Exception
protected String getRPCPortRange(Configuration configuration)
RpcService
.configuration
- to extract the port range fromRpcService
protected RpcService createRpcService(Configuration configuration, String bindAddress, String portRange) throws Exception
Exception
protected HighAvailabilityServices createHaServices(Configuration configuration, Executor executor) throws Exception
Exception
protected HeartbeatServices createHeartbeatServices(Configuration configuration)
protected MetricRegistryImpl createMetricRegistry(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(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(Configuration configuration, ResourceID resourceId, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, MetricRegistry metricRegistry, FatalErrorHandler fatalErrorHandler, ClusterInformation clusterInformation, @Nullable String webInterfaceUrl, JobManagerMetricGroup jobManagerMetricGroup) throws Exception
Exception
protected abstract WebMonitorEndpoint<?> createRestEndpoint(Configuration configuration, LeaderGatewayRetriever<DispatcherGateway> dispatcherGatewayRetriever, LeaderGatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever, TransientBlobService transientBlobService, ExecutorService executor, MetricQueryServiceRetriever metricQueryServiceRetriever, LeaderElectionService leaderElectionService) throws Exception
Exception
protected abstract ArchivedExecutionGraphStore createSerializableExecutionGraphStore(Configuration configuration, ScheduledExecutor scheduledExecutor) throws IOException
IOException
protected static ClusterConfiguration parseArguments(String[] args)
protected static Configuration loadConfiguration(ClusterConfiguration clusterConfiguration)
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.