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 ExecutorService |
executor |
protected GatewayRetriever<? extends T> |
leaderRetriever |
protected RestHandlerConfiguration |
restConfiguration |
log, responseHeaders, uploadDir| Constructor and Description |
|---|
WebMonitorEndpoint(RestServerEndpointConfiguration endpointConfiguration,
GatewayRetriever<? extends T> leaderRetriever,
org.apache.flink.configuration.Configuration clusterConfiguration,
RestHandlerConfiguration restConfiguration,
GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever,
TransientBlobService transientBlobService,
ExecutorService executor,
MetricFetcher metricFetcher,
LeaderElectionService leaderElectionService,
FatalErrorHandler fatalErrorHandler) |
| Modifier and Type | Method and Description |
|---|---|
Collection<ArchivedJson> |
archiveJsonWithPath(AccessExecutionGraph graph)
Returns a
Collection of ArchivedJsons containing JSON responses and their respective REST URL
for a given job. |
static ExecutorService |
createExecutorService(int numThreads,
int threadPriority,
String componentName) |
String |
getDescription()
Returns the description of the
LeaderContender for logging purposes. |
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. |
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, getServerAddress, startprotected final GatewayRetriever<? extends T extends RestfulGateway> leaderRetriever
protected final org.apache.flink.configuration.Configuration clusterConfiguration
protected final RestHandlerConfiguration restConfiguration
protected final ExecutorService executor
public WebMonitorEndpoint(RestServerEndpointConfiguration endpointConfiguration, GatewayRetriever<? extends T> leaderRetriever, org.apache.flink.configuration.Configuration clusterConfiguration, RestHandlerConfiguration restConfiguration, GatewayRetriever<ResourceManagerGateway> resourceManagerRetriever, TransientBlobService transientBlobService, ExecutorService executor, MetricFetcher metricFetcher, LeaderElectionService leaderElectionService, FatalErrorHandler fatalErrorHandler) throws IOException
IOExceptionprotected 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 RestServerEndpointpublic 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 String getDescription()
LeaderContenderLeaderContender for logging purposes.getDescription 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(AccessExecutionGraph graph) 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 JsonArchivistgraph - AccessExecutionGraph for which the responses should be generatedIOException - thrown if the JSON generation failspublic static ExecutorService createExecutorService(int numThreads, int threadPriority, String componentName)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.