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.
  • Method Details

    • 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 StaticFileServerHandler
      timeout - for lookup requests
      tmpDir - 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 the WebMonitorExtension which enables web submission.
      Parameters:
      leaderRetriever - to retrieve the leader
      timeout - for asynchronous requests
      responseHeaders - for the web submission handlers
      localAddressFuture - of the underlying REST server endpoint
      uploadDir - where the web submission handler store uploaded jars
      executor - to run asynchronous operations
      configuration - 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