diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandler.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandler.java index 6d5f49d55b4cee..8025a375841249 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandler.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandler.java @@ -242,7 +242,6 @@ private static JobExceptionsInfoWithHistory.RootExceptionInfo createRootExceptio historyEntry.getFailureLabels(), historyEntry.getFailingTaskName(), toString(historyEntry.getTaskManagerLocation()), - toString(historyEntry.getTaskManagerLocation()), toTaskManagerId(historyEntry.getTaskManagerLocation()), concurrentExceptions); } @@ -258,7 +257,6 @@ private static JobExceptionsInfoWithHistory.ExceptionInfo createExceptionInfo( exceptionHistoryEntry.getFailureLabels(), null, null, - null, null); } @@ -271,7 +269,6 @@ private static JobExceptionsInfoWithHistory.ExceptionInfo createExceptionInfo( exceptionHistoryEntry.getFailureLabels(), exceptionHistoryEntry.getFailingTaskName(), toString(exceptionHistoryEntry.getTaskManagerLocation()), - toString(exceptionHistoryEntry.getTaskManagerLocation()), toTaskManagerId(exceptionHistoryEntry.getTaskManagerLocation())); } diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistory.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistory.java index c99dcedc540658..bf174f809f74bc 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistory.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistory.java @@ -176,7 +176,6 @@ public static class ExceptionInfo { public static final String FIELD_NAME_EXCEPTION_STACKTRACE = "stacktrace"; public static final String FIELD_NAME_EXCEPTION_TIMESTAMP = "timestamp"; public static final String FIELD_NAME_TASK_NAME = "taskName"; - @Deprecated public static final String FIELD_NAME_LOCATION = "location"; public static final String FIELD_NAME_ENDPOINT = "endpoint"; public static final String FIELD_NAME_TASK_MANAGER_ID = "taskManagerId"; public static final String FIELD_NAME_FAILURE_LABELS = "failureLabels"; @@ -195,13 +194,6 @@ public static class ExceptionInfo { @Nullable private final String taskName; - /** @deprecated Use {@link ExceptionInfo#endpoint} instead. */ - @Deprecated - @JsonInclude(NON_NULL) - @JsonProperty(FIELD_NAME_LOCATION) - @Nullable - private final String location; - @JsonInclude(NON_NULL) @JsonProperty(FIELD_NAME_ENDPOINT) @Nullable @@ -216,15 +208,7 @@ public static class ExceptionInfo { private final Map failureLabels; public ExceptionInfo(String exceptionName, String stacktrace, long timestamp) { - this( - exceptionName, - stacktrace, - timestamp, - Collections.emptyMap(), - null, - null, - null, - null); + this(exceptionName, stacktrace, timestamp, Collections.emptyMap(), null, null, null); } @JsonCreator @@ -234,7 +218,6 @@ public ExceptionInfo( @JsonProperty(FIELD_NAME_EXCEPTION_TIMESTAMP) long timestamp, @JsonProperty(FIELD_NAME_FAILURE_LABELS) Map failureLabels, @JsonProperty(FIELD_NAME_TASK_NAME) @Nullable String taskName, - @JsonProperty(FIELD_NAME_LOCATION) @Nullable String location, @JsonProperty(FIELD_NAME_ENDPOINT) @Nullable String endpoint, @JsonProperty(FIELD_NAME_TASK_MANAGER_ID) @Nullable String taskManagerId) { this.exceptionName = checkNotNull(exceptionName); @@ -242,7 +225,6 @@ public ExceptionInfo( this.timestamp = timestamp; this.failureLabels = checkNotNull(failureLabels); this.taskName = taskName; - this.location = location; this.endpoint = endpoint; this.taskManagerId = taskManagerId; } @@ -268,13 +250,6 @@ public String getTaskName() { return taskName; } - @Deprecated - @JsonIgnore - @Nullable - public String getLocation() { - return location; - } - @JsonIgnore @Nullable public String getEndpoint() { @@ -308,20 +283,13 @@ public boolean equals(Object o) { && Objects.equals(timestamp, that.timestamp) && Objects.equals(failureLabels, that.failureLabels) && Objects.equals(taskName, that.taskName) - && Objects.equals(location, that.location) && Objects.equals(endpoint, that.endpoint); } @Override public int hashCode() { return Objects.hash( - exceptionName, - stacktrace, - timestamp, - failureLabels, - taskName, - location, - endpoint); + exceptionName, stacktrace, timestamp, failureLabels, taskName, endpoint); } @Override @@ -362,7 +330,6 @@ public RootExceptionInfo( null, null, null, - null, concurrentExceptions); } @@ -373,7 +340,6 @@ public RootExceptionInfo( @JsonProperty(FIELD_NAME_EXCEPTION_TIMESTAMP) long timestamp, @JsonProperty(FIELD_NAME_FAILURE_LABELS) Map failureLabels, @JsonProperty(FIELD_NAME_TASK_NAME) @Nullable String taskName, - @JsonProperty(FIELD_NAME_LOCATION) @Nullable String location, @JsonProperty(FIELD_NAME_ENDPOINT) @Nullable String endpoint, @JsonProperty(FIELD_NAME_TASK_MANAGER_ID) @Nullable String taskManagerId, @JsonProperty(FIELD_NAME_CONCURRENT_EXCEPTIONS) @@ -384,7 +350,6 @@ public RootExceptionInfo( timestamp, failureLabels, taskName, - location, endpoint, taskManagerId); this.concurrentExceptions = concurrentExceptions; diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandlerTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandlerTest.java index c40bdb2c8e880e..76e974cae086f9 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandlerTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandlerTest.java @@ -710,7 +710,7 @@ private static class ExceptionInfoMatcher extends TypeSafeDiagnosingMatcher expectedFailureLabels; private final String expectedTaskName; - private final String expectedLocation; + private final String expectedEndpoint; private final String expectedTaskManagerId; private ExceptionInfoMatcher( @@ -718,14 +718,14 @@ private ExceptionInfoMatcher( long expectedTimestamp, CompletableFuture> expectedFailureLabels, String expectedTaskName, - String expectedLocation, + String expectedEndpoint, String expectedTaskManagerId) throws ExecutionException, InterruptedException { this.expectedException = deserializeSerializedThrowable(expectedException); this.expectedTimestamp = expectedTimestamp; this.expectedFailureLabels = expectedFailureLabels.get(); this.expectedTaskName = expectedTaskName; - this.expectedLocation = expectedLocation; + this.expectedEndpoint = expectedEndpoint; this.expectedTaskManagerId = expectedTaskManagerId; } @@ -742,8 +742,8 @@ public void describeTo(Description description) { .appendText(String.valueOf(expectedFailureLabels)) .appendText(", taskName=") .appendText(expectedTaskName) - .appendText(", location=") - .appendText(expectedLocation) + .appendText(", endpoint=") + .appendText(expectedEndpoint) .appendText(", taskManagerId=") .appendText(expectedTaskManagerId); } @@ -785,8 +785,8 @@ && matches( && matches( info, description, - ExceptionInfo::getLocation, - expectedLocation, + ExceptionInfo::getEndpoint, + expectedEndpoint, "location") && matches( info, diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistoryNoRootTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistoryNoRootTest.java index 3bb7d1be0b9c90..eb35780142cfbf 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistoryNoRootTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistoryNoRootTest.java @@ -77,7 +77,6 @@ protected JobExceptionsInfoWithHistory getTestResponseInstance() throws Exceptio Collections.emptyMap(), "task name #2", "location #2", - "location #2", "taskManagerId #2"))), new JobExceptionsInfoWithHistory.RootExceptionInfo( "local task failure #1", @@ -86,7 +85,6 @@ protected JobExceptionsInfoWithHistory getTestResponseInstance() throws Exceptio Collections.emptyMap(), "task name", "location", - "location", "taskManagerId", Collections.emptyList())), false));