public final class WebMonitorUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
WebMonitorUtils.LogFileLocation
Singleton to hold the log file, the stdout file, the log directory.
|
Modifier and Type | Method and Description |
---|---|
static Map<String,String> |
fromKeyValueJsonArray(String jsonString) |
static WebMonitorExtension |
loadWebSubmissionExtension(GatewayRetriever<? extends DispatcherGateway> leaderRetriever,
Time timeout,
Map<String,String> responseHeaders,
CompletableFuture<String> localAddressFuture,
Path uploadDir,
Executor executor,
Configuration configuration)
Loads the
WebMonitorExtension which enables web submission. |
static <T extends RestfulGateway> |
tryLoadWebContent(GatewayRetriever<? extends T> leaderRetriever,
Time 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.
|
static Path |
validateAndNormalizeUri(URI archiveDirUri)
Checks and normalizes the given URI.
|
public static <T extends RestfulGateway> Optional<StaticFileServerHandler<T>> tryLoadWebContent(GatewayRetriever<? extends T> leaderRetriever, Time timeout, File tmpDir) throws IOException
T
- type of the gateway to retrieveleaderRetriever
- to be used by the StaticFileServerHandlertimeout
- for lookup requeststmpDir
- to be used by the StaticFileServerHandler to store temporary filesIOException
- if we cannot create the StaticFileServerHandlerpublic static WebMonitorExtension loadWebSubmissionExtension(GatewayRetriever<? extends DispatcherGateway> leaderRetriever, Time timeout, Map<String,String> responseHeaders, CompletableFuture<String> localAddressFuture, Path uploadDir, Executor executor, Configuration configuration) throws FlinkException
WebMonitorExtension
which enables web submission.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 extensionFlinkException
- if the web submission extension could not be loadedpublic static Path validateAndNormalizeUri(URI archiveDirUri)
archiveDirUri
- The URI to check and normalize.IllegalArgumentException
- Thrown, if the URI misses scheme or path.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.