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 Configuration |
clusterConfiguration |
protected ScheduledExecutorService |
executor |
protected GatewayRetriever<? extends T> |
leaderRetriever |
protected RestHandlerConfiguration |
restConfiguration |
log, responseHeaders, uploadDir
Constructor and Description |
---|
WebMonitorEndpoint(GatewayRetriever<? extends T> leaderRetriever,
Configuration clusterConfiguration,
RestHandlerConfiguration restConfiguration,
GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
TransientBlobService transientBlobService,
ScheduledExecutorService executor,
MetricFetcher metricFetcher,
LeaderElection leaderElection,
ExecutionGraphCache executionGraphCache,
FatalErrorHandler fatalErrorHandler) |
Modifier and Type | Method and Description |
---|---|
Collection<ArchivedJson> |
archiveJsonWithPath(ExecutionGraphInfo executionGraphInfo)
Returns a
Collection of ArchivedJson s 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<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<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, start
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
protected final GatewayRetriever<? extends T extends RestfulGateway> leaderRetriever
protected final Configuration clusterConfiguration
protected final RestHandlerConfiguration restConfiguration
protected final ScheduledExecutorService executor
public WebMonitorEndpoint(GatewayRetriever<? extends T> leaderRetriever, Configuration clusterConfiguration, RestHandlerConfiguration restConfiguration, GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever, TransientBlobService transientBlobService, ScheduledExecutorService executor, MetricFetcher metricFetcher, LeaderElection leaderElection, ExecutionGraphCache executionGraphCache, FatalErrorHandler fatalErrorHandler) throws IOException, ConfigurationException
IOException
ConfigurationException
protected List<Tuple2<RestHandlerSpecification,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler>> initializeHandlers(CompletableFuture<String> localAddressFuture)
RestServerEndpoint
RestServerEndpoint.start()
to setup all handlers that the
REST server endpoint implementation requires.initializeHandlers
in class RestServerEndpoint
localAddressFuture
- future rest address of the RestServerEndpointprotected Collection<Tuple2<RestHandlerSpecification,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler>> initializeWebSubmissionHandlers(CompletableFuture<String> localAddressFuture)
public void startInternal() throws Exception
RestServerEndpoint
startInternal
in class RestServerEndpoint
Exception
- if an error occurredprotected CompletableFuture<Void> shutDownInternal()
RestServerEndpoint
shutDownInternal
in class RestServerEndpoint
public void grantLeadership(UUID leaderSessionID)
LeaderContender
LeaderElectionService
upon selecting this
instance as the new leader. The method is called with the new leader session ID.grantLeadership
in interface LeaderContender
leaderSessionID
- New leader session IDpublic void revokeLeadership()
LeaderContender
LeaderElectionService
upon revoking the
leadership of a former leader. This might happen in case that multiple contenders have been
granted leadership.revokeLeadership
in interface LeaderContender
public void handleError(Exception exception)
LeaderContender
LeaderElectionService
in case of an error in the
service thread.handleError
in interface LeaderContender
exception
- Caught exceptionpublic Collection<ArchivedJson> archiveJsonWithPath(ExecutionGraphInfo executionGraphInfo) throws IOException
JsonArchivist
Collection
of ArchivedJson
s 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 JsonArchivist
executionGraphInfo
- 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.