Github user GJL commented on a diff in the pull request: https://github.com/apache/flink/pull/5442#discussion_r167930099 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java --- @@ -207,6 +215,53 @@ public static WebMonitor startWebRuntimeMonitor( } } + @SuppressWarnings({"unchecked", "rawtypes"}) + public static <T extends RestfulGateway> List<Tuple2<RestHandlerSpecification, ChannelInboundHandler>> tryLoadJarUploadHandler( + GatewayRetriever<T> leaderRetriever, + CompletableFuture<String> restAddressFuture, + Time timeout, + java.nio.file.Path uploadDir, + Executor executor) { + + // 1. Check if flink-runtime-web is in the classpath + try { + final String classname = "org.apache.flink.runtime.webmonitor.WebRuntimeMonitor"; + Class.forName(classname).asSubclass(WebMonitor.class); + } catch (ClassNotFoundException e) { + // class not found means that there is no flink-runtime-web in the classpath + return Collections.emptyList(); + } --- End diff -- extracted into a method
---