Class WebMonitorUtils
- java.lang.Object
-
- org.apache.flink.runtime.webmonitor.WebMonitorUtils
-
public final class WebMonitorUtils extends Object
Utilities for the web runtime monitor. This class contains for example methods to build messages with aggregate information about the state of an execution graph, to be send to the web server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WebMonitorUtils.LogFileLocation
Singleton to hold the log file, the stdout file, the log directory.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WebMonitorExtension
loadWebSubmissionExtension(GatewayRetriever<? extends DispatcherGateway> leaderRetriever, Duration timeout, Map<String,String> responseHeaders, CompletableFuture<String> localAddressFuture, Path uploadDir, Executor executor, org.apache.flink.configuration.Configuration configuration)
Loads theWebMonitorExtension
which enables web submission.static <T extends RestfulGateway>
Optional<StaticFileServerHandler<T>>tryLoadWebContent(GatewayRetriever<? extends T> leaderRetriever, Duration timeout, File tmpDir)
Checks whether the flink-runtime-web dependency is available and if so returns a StaticFileServerHandler which can serve the static file contents.
-
-
-
Method Detail
-
tryLoadWebContent
public static <T extends RestfulGateway> Optional<StaticFileServerHandler<T>> tryLoadWebContent(GatewayRetriever<? extends T> leaderRetriever, Duration timeout, File tmpDir) throws IOException
Checks whether the flink-runtime-web dependency is available and if so returns a StaticFileServerHandler which can serve the static file contents.- Type Parameters:
T
- type of the gateway to retrieve- Parameters:
leaderRetriever
- to be used by the StaticFileServerHandlertimeout
- for lookup requeststmpDir
- to be used by the StaticFileServerHandler to store temporary files- Returns:
- StaticFileServerHandler if flink-runtime-web is in the classpath; Otherwise Optional.empty
- Throws:
IOException
- if we cannot create the StaticFileServerHandler
-
loadWebSubmissionExtension
public static WebMonitorExtension loadWebSubmissionExtension(GatewayRetriever<? extends DispatcherGateway> leaderRetriever, Duration timeout, Map<String,String> responseHeaders, CompletableFuture<String> localAddressFuture, Path uploadDir, Executor executor, org.apache.flink.configuration.Configuration configuration) throws org.apache.flink.util.FlinkException
Loads theWebMonitorExtension
which enables web submission.- Parameters:
leaderRetriever
- to retrieve the leadertimeout
- for asynchronous requestsresponseHeaders
- for the web submission handlerslocalAddressFuture
- of the underlying REST server endpointuploadDir
- where the web submission handler store uploaded jarsexecutor
- to run asynchronous operationsconfiguration
- used to instantiate the web submission extension- Returns:
- Web submission extension
- Throws:
org.apache.flink.util.FlinkException
- if the web submission extension could not be loaded
-
-