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

    https://github.com/apache/flink/pull/4757#discussion_r143710757
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandler.java
 ---
    @@ -18,26 +18,48 @@
     
     package org.apache.flink.runtime.rest.handler.legacy.metrics;
     
    +import org.apache.flink.api.common.JobID;
    +import org.apache.flink.runtime.dispatcher.DispatcherGateway;
    +import org.apache.flink.runtime.rest.handler.HandlerRequest;
    +import org.apache.flink.runtime.rest.handler.LegacyRestHandler;
    +import 
org.apache.flink.runtime.rest.handler.legacy.messages.JobMetricEntry;
    +import 
org.apache.flink.runtime.rest.handler.legacy.messages.JobMetricEntryList;
    +import 
org.apache.flink.runtime.rest.handler.legacy.messages.JobMetricIdList;
    +import 
org.apache.flink.runtime.rest.handler.legacy.messages.JobMetricsOverview;
    +import org.apache.flink.runtime.rest.messages.EmptyRequestBody;
    +import org.apache.flink.runtime.rest.messages.JobIDPathParameter;
    +import org.apache.flink.runtime.rest.messages.JobIDQueryParameter;
    +import org.apache.flink.runtime.rest.messages.JobMetricsMessageParameters;
    +
    +import java.util.Arrays;
    +import java.util.List;
     import java.util.Map;
    +import java.util.concurrent.CompletableFuture;
     import java.util.concurrent.Executor;
    +import java.util.stream.Collectors;
     
     /**
      * Request handler that returns for a given job a list of all available 
metrics or the values for a set of metrics.
      *
      * <p>If the query parameters do not contain a "get" parameter the list of 
all metrics is returned.
      * {@code {"available": [ { "name" : "X", "id" : "X" } ] } }
      *
    - * <p>If the query parameters do contain a "get" parameter a 
comma-separate list of metric names is expected as a value.
    - * {@code /get?X,Y}
    + * <p>If the query parameters do contain a "get" parameter, a 
comma-separate list of metric names is expected as a value.
    + * {@code ?get=X,Y}
      * The handler will then return a list containing the values of the 
requested metrics.
      * {@code [ { "id" : "X", "value" : "S" }, { "id" : "Y", "value" : "T" } ] 
}
      */
    -public class JobMetricsHandler extends AbstractMetricsHandler {
    +public class JobMetricsHandler extends AbstractMetricsHandler
    +           implements LegacyRestHandler<DispatcherGateway, 
JobMetricsOverview, JobMetricsMessageParameters> {
    --- End diff --
    
    I think `JobMetricsOverview` won't work here, because you have to add 
polymorphic type information. Otherwise Jackson won't be able to restore a 
`JobMetricsOverview` instance.


---

Reply via email to