Skip to content

Commit

Permalink
[FLINK-33147][runtime] Removes deprecated location field (was depreca…
Browse files Browse the repository at this point in the history
…ted in 1.19)
  • Loading branch information
XComp committed Aug 23, 2024
1 parent cfc602e commit 65d7484
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,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";
Expand All @@ -173,13 +172,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
Expand All @@ -194,15 +186,7 @@ public static class ExceptionInfo {
private final Map<String, String> 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
Expand All @@ -212,15 +196,13 @@ public ExceptionInfo(
@JsonProperty(FIELD_NAME_EXCEPTION_TIMESTAMP) long timestamp,
@JsonProperty(FIELD_NAME_FAILURE_LABELS) Map<String, String> 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);
this.stacktrace = checkNotNull(stacktrace);
this.timestamp = timestamp;
this.failureLabels = checkNotNull(failureLabels);
this.taskName = taskName;
this.location = location;
this.endpoint = endpoint;
this.taskManagerId = taskManagerId;
}
Expand All @@ -246,13 +228,6 @@ public String getTaskName() {
return taskName;
}

@Deprecated
@JsonIgnore
@Nullable
public String getLocation() {
return location;
}

@JsonIgnore
@Nullable
public String getEndpoint() {
Expand Down Expand Up @@ -286,20 +261,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
Expand Down Expand Up @@ -340,7 +308,6 @@ public RootExceptionInfo(
null,
null,
null,
null,
concurrentExceptions);
}

Expand All @@ -351,7 +318,6 @@ public RootExceptionInfo(
@JsonProperty(FIELD_NAME_EXCEPTION_TIMESTAMP) long timestamp,
@JsonProperty(FIELD_NAME_FAILURE_LABELS) Map<String, String> 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)
Expand All @@ -362,7 +328,6 @@ public RootExceptionInfo(
timestamp,
failureLabels,
taskName,
location,
endpoint,
taskManagerId);
this.concurrentExceptions = concurrentExceptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,22 +694,22 @@ private static class ExceptionInfoMatcher extends TypeSafeDiagnosingMatcher<Exce
private final long expectedTimestamp;
private final Map<String, String> expectedFailureLabels;
private final String expectedTaskName;
private final String expectedLocation;
private final String expectedEndpoint;
private final String expectedTaskManagerId;

private ExceptionInfoMatcher(
Throwable expectedException,
long expectedTimestamp,
CompletableFuture<Map<String, String>> 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;
}

Expand All @@ -726,8 +726,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);
}
Expand Down Expand Up @@ -769,8 +769,8 @@ && matches(
&& matches(
info,
description,
ExceptionInfo::getLocation,
expectedLocation,
ExceptionInfo::getEndpoint,
expectedEndpoint,
"location")
&& matches(
info,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ protected JobExceptionsInfoWithHistory getTestResponseInstance() throws Exceptio
Collections.emptyMap(),
"task name #2",
"location #2",
"location #2",
"taskManagerId #2"))),
new JobExceptionsInfoWithHistory.RootExceptionInfo(
"local task failure #1",
Expand All @@ -64,7 +63,6 @@ protected JobExceptionsInfoWithHistory getTestResponseInstance() throws Exceptio
Collections.emptyMap(),
"task name",
"location",
"location",
"taskManagerId",
Collections.emptyList())),
false));
Expand Down

0 comments on commit 65d7484

Please sign in to comment.