Github user GJL commented on a diff in the pull request: https://github.com/apache/flink/pull/5168#discussion_r157026590 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobExecutionResultHandler.java --- @@ -0,0 +1,107 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.runtime.rest.handler.job; + +import org.apache.flink.api.common.JobID; +import org.apache.flink.api.common.time.Time; +import org.apache.flink.runtime.messages.FlinkJobNotFoundException; +import org.apache.flink.runtime.messages.JobExecutionResultNotFoundException; +import org.apache.flink.runtime.rest.handler.AbstractRestHandler; +import org.apache.flink.runtime.rest.handler.HandlerRequest; +import org.apache.flink.runtime.rest.handler.RestHandlerException; +import org.apache.flink.runtime.rest.messages.EmptyRequestBody; +import org.apache.flink.runtime.rest.messages.JobIDPathParameter; +import org.apache.flink.runtime.rest.messages.JobMessageParameters; +import org.apache.flink.runtime.rest.messages.job.JobExecutionResult; +import org.apache.flink.runtime.rest.messages.job.JobExecutionResultHeaders; +import org.apache.flink.runtime.rest.messages.job.JobExecutionResultResponseBody; +import org.apache.flink.runtime.webmonitor.RestfulGateway; +import org.apache.flink.runtime.webmonitor.retriever.GatewayRetriever; +import org.apache.flink.util.ExceptionUtils; + +import org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpResponseStatus; + +import javax.annotation.Nonnull; + +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; + +/** + * Returns the {@link org.apache.flink.api.common.JobExecutionResult} for a given {@link JobID}. + */ +public class JobExecutionResultHandler --- End diff -- Sample response after running batch WordCount example: ``` { "status": { "id": "CREATED" }, "job-execution-result": { "id": "533a165a6de7f70919a54b1d6f36d3b3", "net-runtime": 0, "accumulator-results": { "94a58184eb17398571f35da42b714517": "rO0ABXNyABNqYXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAACqdwQAAACqdXIAAltCrPMX+AYIVOACAAB4cAAAAAYCYQAAAAV1cQB+AAIAAAALB2FjdGlvbgAAAAF1cQB+AAIAAAAKBmFmdGVyAAAAAXVxAH4AAgAAAAwIYWdhaW5zdAAAAAF1cQB+AAIAAAAIBGFsbAAAAAJ1cQB+AAIAAAAIBGFuZAAAAAx1cQB+AAIAAAAJBWFybXMAAAABdXEAfgACAAAACwdhcnJvd3MAAAABdXEAfgACAAAACQVhd3J5AAAAAXVxAH4AAgAAAAcDYXkAAAABdXEAfgACAAAACQViYXJlAAAAAXVxAH4AAgAAAAcDYmUAAAAEdXEAfgACAAAACQViZWFyAAAAA3VxAH4AAgAAAAsHYm9ka2luAAAAAXVxAH4AAgAAAAoGYm91cm4AAAABdXEAfgACAAAACARidXQAAAABdXEAfgACAAAABwNieQAAAAJ1cQB+AAIAAAANCWNhbGFtaXR5AAAAAXVxAH4AAgAAAAkFY2FzdAAAAAF1cQB+AAIAAAAJBWNvaWwAAAABdXEAfgACAAAACQVjb21lAAAAAXVxAH4AAgAAAA8LY29uc2NpZW5jZQAAAAF1cQB+AAIAAAARDWNvbnN1bW1hdGlvbgAAAAF1cQB+AAIAAAAOCmNvbnR1bWVseQAAAAF1cQB+AAIAAAAMCGNvdW50cnkAAAABdXEAfgACAAAADAhjb3dhcmRzAAAAAXVxAH4AAgAAAA0JY3VycmVudHMAAAABdXEAfgACAAAABgJkAAAABHVxAH4AAgAAAAoGZGVhdGgAAAACdXEAfgACAAAACgZkZWxheQAAAAF1cQB+AAIAAAALB2Rlc3BpcwAAAAF1cQB+AAIAAAANCWRldm91dGx5A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