Skip to content

Commit 721c6a2

Browse files
committed
[FLINK-36147][runtime] Removes deprecated location field (was deprecated in 1.19)
1 parent bed5c2e commit 721c6a2

File tree

5 files changed

+9
-55
lines changed

5 files changed

+9
-55
lines changed

flink-runtime-web/src/test/resources/rest_api_v1.snapshot

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,9 +2025,6 @@
20252025
"taskName" : {
20262026
"type" : "string"
20272027
},
2028-
"location" : {
2029-
"type" : "string"
2030-
},
20312028
"endpoint" : {
20322029
"type" : "string"
20332030
},
@@ -2058,9 +2055,6 @@
20582055
"taskName" : {
20592056
"type" : "string"
20602057
},
2061-
"location" : {
2062-
"type" : "string"
2063-
},
20642058
"endpoint" : {
20652059
"type" : "string"
20662060
},

flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandler.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ private static JobExceptionsInfoWithHistory.RootExceptionInfo createRootExceptio
242242
historyEntry.getFailureLabels(),
243243
historyEntry.getFailingTaskName(),
244244
toString(historyEntry.getTaskManagerLocation()),
245-
toString(historyEntry.getTaskManagerLocation()),
246245
toTaskManagerId(historyEntry.getTaskManagerLocation()),
247246
concurrentExceptions);
248247
}
@@ -258,7 +257,6 @@ private static JobExceptionsInfoWithHistory.ExceptionInfo createExceptionInfo(
258257
exceptionHistoryEntry.getFailureLabels(),
259258
null,
260259
null,
261-
null,
262260
null);
263261
}
264262

@@ -271,7 +269,6 @@ private static JobExceptionsInfoWithHistory.ExceptionInfo createExceptionInfo(
271269
exceptionHistoryEntry.getFailureLabels(),
272270
exceptionHistoryEntry.getFailingTaskName(),
273271
toString(exceptionHistoryEntry.getTaskManagerLocation()),
274-
toString(exceptionHistoryEntry.getTaskManagerLocation()),
275272
toTaskManagerId(exceptionHistoryEntry.getTaskManagerLocation()));
276273
}
277274

flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistory.java

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ public static class ExceptionInfo {
176176
public static final String FIELD_NAME_EXCEPTION_STACKTRACE = "stacktrace";
177177
public static final String FIELD_NAME_EXCEPTION_TIMESTAMP = "timestamp";
178178
public static final String FIELD_NAME_TASK_NAME = "taskName";
179-
@Deprecated public static final String FIELD_NAME_LOCATION = "location";
180179
public static final String FIELD_NAME_ENDPOINT = "endpoint";
181180
public static final String FIELD_NAME_TASK_MANAGER_ID = "taskManagerId";
182181
public static final String FIELD_NAME_FAILURE_LABELS = "failureLabels";
@@ -195,13 +194,6 @@ public static class ExceptionInfo {
195194
@Nullable
196195
private final String taskName;
197196

198-
/** @deprecated Use {@link ExceptionInfo#endpoint} instead. */
199-
@Deprecated
200-
@JsonInclude(NON_NULL)
201-
@JsonProperty(FIELD_NAME_LOCATION)
202-
@Nullable
203-
private final String location;
204-
205197
@JsonInclude(NON_NULL)
206198
@JsonProperty(FIELD_NAME_ENDPOINT)
207199
@Nullable
@@ -216,15 +208,7 @@ public static class ExceptionInfo {
216208
private final Map<String, String> failureLabels;
217209

218210
public ExceptionInfo(String exceptionName, String stacktrace, long timestamp) {
219-
this(
220-
exceptionName,
221-
stacktrace,
222-
timestamp,
223-
Collections.emptyMap(),
224-
null,
225-
null,
226-
null,
227-
null);
211+
this(exceptionName, stacktrace, timestamp, Collections.emptyMap(), null, null, null);
228212
}
229213

230214
@JsonCreator
@@ -234,15 +218,13 @@ public ExceptionInfo(
234218
@JsonProperty(FIELD_NAME_EXCEPTION_TIMESTAMP) long timestamp,
235219
@JsonProperty(FIELD_NAME_FAILURE_LABELS) Map<String, String> failureLabels,
236220
@JsonProperty(FIELD_NAME_TASK_NAME) @Nullable String taskName,
237-
@JsonProperty(FIELD_NAME_LOCATION) @Nullable String location,
238221
@JsonProperty(FIELD_NAME_ENDPOINT) @Nullable String endpoint,
239222
@JsonProperty(FIELD_NAME_TASK_MANAGER_ID) @Nullable String taskManagerId) {
240223
this.exceptionName = checkNotNull(exceptionName);
241224
this.stacktrace = checkNotNull(stacktrace);
242225
this.timestamp = timestamp;
243226
this.failureLabels = checkNotNull(failureLabels);
244227
this.taskName = taskName;
245-
this.location = location;
246228
this.endpoint = endpoint;
247229
this.taskManagerId = taskManagerId;
248230
}
@@ -268,13 +250,6 @@ public String getTaskName() {
268250
return taskName;
269251
}
270252

271-
@Deprecated
272-
@JsonIgnore
273-
@Nullable
274-
public String getLocation() {
275-
return location;
276-
}
277-
278253
@JsonIgnore
279254
@Nullable
280255
public String getEndpoint() {
@@ -308,20 +283,13 @@ public boolean equals(Object o) {
308283
&& Objects.equals(timestamp, that.timestamp)
309284
&& Objects.equals(failureLabels, that.failureLabels)
310285
&& Objects.equals(taskName, that.taskName)
311-
&& Objects.equals(location, that.location)
312286
&& Objects.equals(endpoint, that.endpoint);
313287
}
314288

315289
@Override
316290
public int hashCode() {
317291
return Objects.hash(
318-
exceptionName,
319-
stacktrace,
320-
timestamp,
321-
failureLabels,
322-
taskName,
323-
location,
324-
endpoint);
292+
exceptionName, stacktrace, timestamp, failureLabels, taskName, endpoint);
325293
}
326294

327295
@Override
@@ -362,7 +330,6 @@ public RootExceptionInfo(
362330
null,
363331
null,
364332
null,
365-
null,
366333
concurrentExceptions);
367334
}
368335

@@ -373,7 +340,6 @@ public RootExceptionInfo(
373340
@JsonProperty(FIELD_NAME_EXCEPTION_TIMESTAMP) long timestamp,
374341
@JsonProperty(FIELD_NAME_FAILURE_LABELS) Map<String, String> failureLabels,
375342
@JsonProperty(FIELD_NAME_TASK_NAME) @Nullable String taskName,
376-
@JsonProperty(FIELD_NAME_LOCATION) @Nullable String location,
377343
@JsonProperty(FIELD_NAME_ENDPOINT) @Nullable String endpoint,
378344
@JsonProperty(FIELD_NAME_TASK_MANAGER_ID) @Nullable String taskManagerId,
379345
@JsonProperty(FIELD_NAME_CONCURRENT_EXCEPTIONS)
@@ -384,7 +350,6 @@ public RootExceptionInfo(
384350
timestamp,
385351
failureLabels,
386352
taskName,
387-
location,
388353
endpoint,
389354
taskManagerId);
390355
this.concurrentExceptions = concurrentExceptions;

flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandlerTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -710,22 +710,22 @@ private static class ExceptionInfoMatcher extends TypeSafeDiagnosingMatcher<Exce
710710
private final long expectedTimestamp;
711711
private final Map<String, String> expectedFailureLabels;
712712
private final String expectedTaskName;
713-
private final String expectedLocation;
713+
private final String expectedEndpoint;
714714
private final String expectedTaskManagerId;
715715

716716
private ExceptionInfoMatcher(
717717
Throwable expectedException,
718718
long expectedTimestamp,
719719
CompletableFuture<Map<String, String>> expectedFailureLabels,
720720
String expectedTaskName,
721-
String expectedLocation,
721+
String expectedEndpoint,
722722
String expectedTaskManagerId)
723723
throws ExecutionException, InterruptedException {
724724
this.expectedException = deserializeSerializedThrowable(expectedException);
725725
this.expectedTimestamp = expectedTimestamp;
726726
this.expectedFailureLabels = expectedFailureLabels.get();
727727
this.expectedTaskName = expectedTaskName;
728-
this.expectedLocation = expectedLocation;
728+
this.expectedEndpoint = expectedEndpoint;
729729
this.expectedTaskManagerId = expectedTaskManagerId;
730730
}
731731

@@ -742,8 +742,8 @@ public void describeTo(Description description) {
742742
.appendText(String.valueOf(expectedFailureLabels))
743743
.appendText(", taskName=")
744744
.appendText(expectedTaskName)
745-
.appendText(", location=")
746-
.appendText(expectedLocation)
745+
.appendText(", endpoint=")
746+
.appendText(expectedEndpoint)
747747
.appendText(", taskManagerId=")
748748
.appendText(expectedTaskManagerId);
749749
}
@@ -785,8 +785,8 @@ && matches(
785785
&& matches(
786786
info,
787787
description,
788-
ExceptionInfo::getLocation,
789-
expectedLocation,
788+
ExceptionInfo::getEndpoint,
789+
expectedEndpoint,
790790
"location")
791791
&& matches(
792792
info,

flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobExceptionsInfoWithHistoryNoRootTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ protected JobExceptionsInfoWithHistory getTestResponseInstance() throws Exceptio
7777
Collections.emptyMap(),
7878
"task name #2",
7979
"location #2",
80-
"location #2",
8180
"taskManagerId #2"))),
8281
new JobExceptionsInfoWithHistory.RootExceptionInfo(
8382
"local task failure #1",
@@ -86,7 +85,6 @@ protected JobExceptionsInfoWithHistory getTestResponseInstance() throws Exceptio
8685
Collections.emptyMap(),
8786
"task name",
8887
"location",
89-
"location",
9088
"taskManagerId",
9189
Collections.emptyList())),
9290
false));

0 commit comments

Comments
 (0)