[
https://issues.apache.org/jira/browse/FLINK-17595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17105322#comment-17105322
]
Gary Yao commented on FLINK-17595:
----------------------------------
The REST API, i.e., the specification of the JSON requests and responses, is a
public API and guaranteed to be stable. However, the Java classes used to
implement the REST API are not part of the public API (not annotated with
{{@Public}} or {{@PublicEvolving}}). Even if we added a getter to
{{ExecutionExceptionInfo}}, we would not guarantee that the class won't be
renamed or moved to a different package in a next Flink release. Moreover, the
{{RestClusterClient}} is not part of the public API;
{{RestClusterClient#sendRequest()}} is even annotated with
{{@VisibleForTesting}}. The problem seems to be that in the Flink project there
is not yet a reference client implementation to programmatically interact with
the REST API. All in all, I am currently against adding a getter to
{{ExecutionExceptionInfo}}. What you can do in the meantime as a workaround is:
* Access the required field by reflection
* Copy the class and add a getter yourself
* Implement your own client from scratch
> JobExceptionsInfo. ExecutionExceptionInfo miss getter method
> ------------------------------------------------------------
>
> Key: FLINK-17595
> URL: https://issues.apache.org/jira/browse/FLINK-17595
> Project: Flink
> Issue Type: Bug
> Components: Runtime / REST
> Affects Versions: 1.10.0
> Reporter: Wei Zhang
> Priority: Minor
> Fix For: 1.11.0
>
>
> {code:java}
> public static final class ExecutionExceptionInfo {
> public static final String FIELD_NAME_EXCEPTION = "exception";
> public static final String FIELD_NAME_TASK = "task";
> public static final String FIELD_NAME_LOCATION = "location";
> public static final String FIELD_NAME_TIMESTAMP = "timestamp";
> @JsonProperty(FIELD_NAME_EXCEPTION)
> private final String exception;
> @JsonProperty(FIELD_NAME_TASK)
> private final String task;
> @JsonProperty(FIELD_NAME_LOCATION)
> private final String location;
> @JsonProperty(FIELD_NAME_TIMESTAMP)
> private final long timestamp;
> @JsonCreator
> public ExecutionExceptionInfo(
> @JsonProperty(FIELD_NAME_EXCEPTION) String exception,
> @JsonProperty(FIELD_NAME_TASK) String task,
> @JsonProperty(FIELD_NAME_LOCATION) String location,
> @JsonProperty(FIELD_NAME_TIMESTAMP) long timestamp) {
> this.exception = Preconditions.checkNotNull(exception);
> this.task = Preconditions.checkNotNull(task);
> this.location = Preconditions.checkNotNull(location);
> this.timestamp = timestamp;
> }
> @Override
> public boolean equals(Object o) {
> if (this == o) {
> return true;
> }
> if (o == null || getClass() != o.getClass()) {
> return false;
> }
> JobExceptionsInfo.ExecutionExceptionInfo that =
> (JobExceptionsInfo.ExecutionExceptionInfo) o;
> return timestamp == that.timestamp &&
> Objects.equals(exception, that.exception) &&
> Objects.equals(task, that.task) &&
> Objects.equals(location, that.location);
> }
> @Override
> public int hashCode() {
> return Objects.hash(timestamp, exception, task,
> location);
> }
> {code}
> I found jobexceptionsinfo.executionexceptioninfo has no getter method for the
> field, is it missing?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)