[ 
https://issues.apache.org/jira/browse/FLINK-7713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358504#comment-16358504
 ] 

ASF GitHub Bot commented on FLINK-7713:
---------------------------------------

Github user GJL commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5442#discussion_r167249950
  
    --- 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();
    +           }
    +
    +           try {
    +                   final String classname = 
"org.apache.flink.runtime.webmonitor.handlers.ng.JarUploadHandler";
    +                   final Class<?> clazz = Class.forName(classname);
    +                   final Constructor<?> constructor = clazz.getConstructor(
    +                           CompletableFuture.class,
    +                           GatewayRetriever.class,
    +                           Time.class,
    +                           Map.class,
    +                           MessageHeaders.class,
    +                           java.nio.file.Path.class,
    +                           Executor.class);
    +
    +                   final MessageHeaders jarUploadMessageHeaders =
    +                           (MessageHeaders) Class
    +                                   
.forName("org.apache.flink.runtime.webmonitor.handlers.ng.JarUploadMessageHeaders")
    +                                   .newInstance();
    +
    +                   return Arrays.asList(Tuple2.of(jarUploadMessageHeaders, 
(ChannelInboundHandler) constructor.newInstance(
    +                           restAddressFuture,
    +                           leaderRetriever,
    +                           timeout,
    +                           Collections.emptyMap(),
    --- End diff --
    
    should use headers defined by `restConfiguration.getResponseHeaders()`


> Port JarUploadHandler to new REST endpoint
> ------------------------------------------
>
>                 Key: FLINK-7713
>                 URL: https://issues.apache.org/jira/browse/FLINK-7713
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Distributed Coordination, REST, Webfrontend
>            Reporter: Tzu-Li (Gordon) Tai
>            Assignee: Gary Yao
>            Priority: Major
>              Labels: flip-6
>             Fix For: 1.5.0
>
>
> Port {{JarUploadHandler}} to new REST endpoint.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to