T - type of the leader gatewaypublic class WebMonitorEndpoint<T extends RestfulGateway> extends RestServerEndpoint implements LeaderContender, JsonArchivist
RestServerEndpoint.RestHandlerUrlComparator| Modifier and Type | Field and Description |
|---|---|
protected org.apache.flink.configuration.Configuration |
clusterConfiguration |
protected ScheduledExecutorService |
executor |
protected GatewayRetriever<? extends T> |
leaderRetriever |
protected RestHandlerConfiguration |
restConfiguration |
log, responseHeaders, uploadDir| Constructor and Description |
|---|
WebMonitorEndpoint(GatewayRetriever<? extends T> leaderRetriever,
org.apache.flink.configuration.Configuration clusterConfiguration,
RestHandlerConfiguration restConfiguration,
GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
TransientBlobService transientBlobService,
ScheduledExecutorService executor,
MetricFetcher metricFetcher,
LeaderElection leaderElection,
ExecutionGraphCache executionGraphCache,
org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler) |
| Modifier and Type | Method and Description |
|---|---|
Collection<ArchivedJson> |
archiveJsonWithPath(ExecutionGraphInfo executionGraphInfo)
Returns a
Collection of ArchivedJsons containing JSON responses and their
respective REST URL for a given job. |
static ScheduledExecutorService |
createExecutorService(int numThreads,
int threadPriority,
String componentName) |
void |
grantLeadership(UUID leaderSessionID)
Callback method which is called by the
LeaderElectionService upon selecting this
instance as the new leader. |
void |
handleError(Exception exception)
Callback method which is called by
LeaderElectionService in case of an error in the
service thread. |
protected List<org.apache.flink.api.java.tuple.Tuple2<RestHandlerSpecification,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler>> |
initializeHandlers(CompletableFuture<String> localAddressFuture)
This method is called at the beginning of
RestServerEndpoint.start() to setup all handlers that the
REST server endpoint implementation requires. |
protected Collection<org.apache.flink.api.java.tuple.Tuple2<RestHandlerSpecification,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler>> |
initializeWebSubmissionHandlers(CompletableFuture<String> localAddressFuture) |
void |
revokeLeadership()
Callback method which is called by the
LeaderElectionService upon revoking the
leadership of a former leader. |
protected CompletableFuture<Void> |
shutDownInternal()
Stops this REST server endpoint.
|
void |
startInternal()
Hook to start sub class specific services.
|
closeAsync, getRestBaseUrl, getRestPort, getServerAddress, startprotected final GatewayRetriever<? extends T extends RestfulGateway> leaderRetriever
protected final org.apache.flink.configuration.Configuration clusterConfiguration
protected final RestHandlerConfiguration restConfiguration
protected final ScheduledExecutorService executor
public WebMonitorEndpoint(GatewayRetriever<? extends T> leaderRetriever, org.apache.flink.configuration.Configuration clusterConfiguration, RestHandlerConfiguration restConfiguration, GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever, TransientBlobService transientBlobService, ScheduledExecutorService executor, MetricFetcher metricFetcher, LeaderElection leaderElection, ExecutionGraphCache executionGraphCache, org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler) throws IOException, org.apache.flink.util.ConfigurationException
IOExceptionorg.apache.flink.util.ConfigurationExceptionprotected List<org.apache.flink.api.java.tuple.Tuple2<RestHandlerSpecification,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler>> initializeHandlers(CompletableFuture<String> localAddressFuture)
RestServerEndpointRestServerEndpoint.start() to setup all handlers that the
REST server endpoint implementation requires.initializeHandlers in class RestServerEndpointlocalAddressFuture - future rest address of the RestServerEndpointprotected Collection<org.apache.flink.api.java.tuple.Tuple2<RestHandlerSpecification,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler>> initializeWebSubmissionHandlers(CompletableFuture<String> localAddressFuture)
public void startInternal()
throws Exception
RestServerEndpointstartInternal in class RestServerEndpointException - if an error occurredprotected CompletableFuture<Void> shutDownInternal()
RestServerEndpointshutDownInternal in class RestServerEndpointpublic void grantLeadership(UUID leaderSessionID)
LeaderContenderLeaderElectionService upon selecting this
instance as the new leader. The method is called with the new leader session ID.grantLeadership in interface LeaderContenderleaderSessionID - New leader session IDpublic void revokeLeadership()
LeaderContenderLeaderElectionService upon revoking the
leadership of a former leader. This might happen in case that multiple contenders have been
granted leadership.revokeLeadership in interface LeaderContenderpublic void handleError(Exception exception)
LeaderContenderLeaderElectionService in case of an error in the
service thread.handleError in interface LeaderContenderexception - Caught exceptionpublic Collection<ArchivedJson> archiveJsonWithPath(ExecutionGraphInfo executionGraphInfo) throws IOException
JsonArchivistCollection of ArchivedJsons containing JSON responses and their
respective REST URL for a given job.
The collection should contain one entry for every response that could be generated for the given job, for example one entry for each task. The REST URLs should be unique and must not contain placeholders.
archiveJsonWithPath in interface JsonArchivistexecutionGraphInfo - AccessExecutionGraph-related information for which the
responses should be generatedIOException - thrown if the JSON generation failspublic static ScheduledExecutorService createExecutorService(int numThreads, int threadPriority, String componentName)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.