This is an automated email from the ASF dual-hosted git repository. zhuzh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
commit 0261d498cb4538aefc4bb2f14ef08d0dec6db812 Author: Yi Zhang <[email protected]> AuthorDate: Mon Jan 12 11:39:29 2026 +0800 [FLINK-38763][runtime-web] Add applicationId field for JarRunResponse --- .../runtime/webmonitor/handlers/JarRunResponseBody.java | 15 +++++++++++++++ .../webmonitor/handlers/JarRunResponseBodyTest.java | 1 + flink-runtime-web/src/test/resources/rest_api_v1.snapshot | 3 +++ 3 files changed, 19 insertions(+) diff --git a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarRunResponseBody.java b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarRunResponseBody.java index 5503593758c..7025d9102ee 100644 --- a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarRunResponseBody.java +++ b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarRunResponseBody.java @@ -18,8 +18,11 @@ package org.apache.flink.runtime.webmonitor.handlers; +import org.apache.flink.api.common.ApplicationID; import org.apache.flink.api.common.JobID; import org.apache.flink.runtime.rest.messages.ResponseBody; +import org.apache.flink.runtime.rest.messages.json.ApplicationIDDeserializer; +import org.apache.flink.runtime.rest.messages.json.ApplicationIDSerializer; import org.apache.flink.runtime.rest.messages.json.JobIDDeserializer; import org.apache.flink.runtime.rest.messages.json.JobIDSerializer; @@ -33,19 +36,31 @@ import static java.util.Objects.requireNonNull; /** Response for {@link JarRunHandler}. */ public class JarRunResponseBody implements ResponseBody { + private static final String FIELD_NAME_APPLICATION_ID = "applicationId"; + @JsonProperty("jobid") @JsonDeserialize(using = JobIDDeserializer.class) @JsonSerialize(using = JobIDSerializer.class) private final JobID jobId; + @JsonProperty(FIELD_NAME_APPLICATION_ID) + @JsonDeserialize(using = ApplicationIDDeserializer.class) + @JsonSerialize(using = ApplicationIDSerializer.class) + private final ApplicationID applicationId; + @JsonCreator public JarRunResponseBody( @JsonProperty("jobid") @JsonDeserialize(using = JobIDDeserializer.class) final JobID jobId) { this.jobId = requireNonNull(jobId); + this.applicationId = ApplicationID.fromHexString(jobId.toHexString()); } public JobID getJobId() { return jobId; } + + public ApplicationID getApplicationId() { + return applicationId; + } } diff --git a/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarRunResponseBodyTest.java b/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarRunResponseBodyTest.java index 1a30ec54ad5..13f9f3e2115 100644 --- a/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarRunResponseBodyTest.java +++ b/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarRunResponseBodyTest.java @@ -44,5 +44,6 @@ class JarRunResponseBodyTest extends RestResponseMarshallingTestBase<JarRunRespo protected void assertOriginalEqualsToUnmarshalled( final JarRunResponseBody expected, final JarRunResponseBody actual) { assertThat(actual.getJobId()).isEqualTo(expected.getJobId()); + assertThat(actual.getApplicationId()).isEqualTo(expected.getApplicationId()); } } diff --git a/flink-runtime-web/src/test/resources/rest_api_v1.snapshot b/flink-runtime-web/src/test/resources/rest_api_v1.snapshot index 3b37c3eb6f0..87a995c854b 100644 --- a/flink-runtime-web/src/test/resources/rest_api_v1.snapshot +++ b/flink-runtime-web/src/test/resources/rest_api_v1.snapshot @@ -765,6 +765,9 @@ "properties" : { "jobid" : { "type" : "any" + }, + "applicationId" : { + "type" : "any" } } }
