Repository: flink
Updated Branches:
  refs/heads/release-1.5 f6bbdcc2d -> 735c95fbb


[FLINK-8700] Add getters to JobDetailsInfo


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/dbb8d2fb
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/dbb8d2fb
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/dbb8d2fb

Branch: refs/heads/release-1.5
Commit: dbb8d2fb4a7fc058c7e3284602aed95ac9fb1d13
Parents: f6bbdcc
Author: Aljoscha Krettek <aljoscha.kret...@gmail.com>
Authored: Mon Feb 26 10:12:44 2018 +0100
Committer: Aljoscha Krettek <aljoscha.kret...@gmail.com>
Committed: Sun Mar 11 08:31:55 2018 -0700

----------------------------------------------------------------------
 .../runtime/rest/messages/RequestBody.java      |  2 +-
 .../runtime/rest/messages/ResponseBody.java     |  2 +-
 .../rest/messages/job/JobDetailsInfo.java       | 70 ++++++++++++++++++++
 3 files changed, 72 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/dbb8d2fb/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/RequestBody.java
----------------------------------------------------------------------
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/RequestBody.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/RequestBody.java
index ca55b17..8098ccf 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/RequestBody.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/RequestBody.java
@@ -26,7 +26,7 @@ package org.apache.flink.runtime.rest.messages;
  *
  * <p>All fields that should part of the JSON request must be accessible 
either by being public or having a getter.
  *
- * <p>When adding methods that are prefixed with {@code get} make sure to 
annotate them with {@code @JsonIgnore}.
+ * <p>When adding methods that are prefixed with {@code get/is} make sure to 
annotate them with {@code @JsonIgnore}.
  */
 public interface RequestBody {
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/dbb8d2fb/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/ResponseBody.java
----------------------------------------------------------------------
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/ResponseBody.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/ResponseBody.java
index d4e94d1d..ff77966 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/ResponseBody.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/ResponseBody.java
@@ -26,7 +26,7 @@ package org.apache.flink.runtime.rest.messages;
  *
  * <p>All fields that should part of the JSON response must be accessible 
either by being public or having a getter.
  *
- * <p>When adding methods that are prefixed with {@code get} make sure to 
annotate them with {@code @JsonIgnore}.
+ * <p>When adding methods that are prefixed with {@code get/is} make sure to 
annotate them with {@code @JsonIgnore}.
  */
 public interface ResponseBody {
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/dbb8d2fb/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/JobDetailsInfo.java
----------------------------------------------------------------------
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/JobDetailsInfo.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/JobDetailsInfo.java
index 2c74389..f839c18 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/JobDetailsInfo.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/JobDetailsInfo.java
@@ -32,6 +32,7 @@ import 
org.apache.flink.runtime.rest.messages.json.RawJsonDeserializer;
 import org.apache.flink.util.Preconditions;
 
 import 
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import 
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
 import 
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
 import 
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonRawValue;
 import 
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -165,6 +166,66 @@ public class JobDetailsInfo implements ResponseBody {
                return Objects.hash(jobId, name, isStoppable, jobStatus, 
startTime, endTime, duration, now, timestamps, jobVertexInfos, 
jobVerticesPerState, jsonPlan);
        }
 
+       @JsonIgnore
+       public JobID getJobId() {
+               return jobId;
+       }
+
+       @JsonIgnore
+       public String getName() {
+               return name;
+       }
+
+       @JsonIgnore
+       public boolean isStoppable() {
+               return isStoppable;
+       }
+
+       @JsonIgnore
+       public JobStatus getJobStatus() {
+               return jobStatus;
+       }
+
+       @JsonIgnore
+       public long getStartTime() {
+               return startTime;
+       }
+
+       @JsonIgnore
+       public long getEndTime() {
+               return endTime;
+       }
+
+       @JsonIgnore
+       public long getDuration() {
+               return duration;
+       }
+
+       @JsonIgnore
+       public long getNow() {
+               return now;
+       }
+
+       @JsonIgnore
+       public Map<JobStatus, Long> getTimestamps() {
+               return timestamps;
+       }
+
+       @JsonIgnore
+       public Collection<JobVertexDetailsInfo> getJobVertexInfos() {
+               return jobVertexInfos;
+       }
+
+       @JsonIgnore
+       public Map<ExecutionState, Integer> getJobVerticesPerState() {
+               return jobVerticesPerState;
+       }
+
+       @JsonIgnore
+       public String getJsonPlan() {
+               return jsonPlan;
+       }
+
        // ---------------------------------------------------
        // Static inner classes
        // ---------------------------------------------------
@@ -242,38 +303,47 @@ public class JobDetailsInfo implements ResponseBody {
                        this.jobVertexMetrics = 
Preconditions.checkNotNull(jobVertexMetrics);
                }
 
+               @JsonIgnore
                public JobVertexID getJobVertexID() {
                        return jobVertexID;
                }
 
+               @JsonIgnore
                public String getName() {
                        return name;
                }
 
+               @JsonIgnore
                public int getParallelism() {
                        return parallelism;
                }
 
+               @JsonIgnore
                public ExecutionState getExecutionState() {
                        return executionState;
                }
 
+               @JsonIgnore
                public long getStartTime() {
                        return startTime;
                }
 
+               @JsonIgnore
                public long getEndTime() {
                        return endTime;
                }
 
+               @JsonIgnore
                public long getDuration() {
                        return duration;
                }
 
+               @JsonIgnore
                public Map<ExecutionState, Integer> getTasksPerState() {
                        return tasksPerState;
                }
 
+               @JsonIgnore
                public IOMetricsInfo getJobVertexMetrics() {
                        return jobVertexMetrics;
                }

Reply via email to