flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [1/2] flink git commit: [FLINK-8700] Add getters to JobDetailsInfo
Date Mon, 05 Mar 2018 11:13:03 GMT
Repository: flink
Updated Branches:
  refs/heads/master 1e48b722d -> 56fef58a3


[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/7d1c6b44
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/7d1c6b44
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/7d1c6b44

Branch: refs/heads/master
Commit: 7d1c6b44ea2ee8f6b176d3caf57e76a88ea17686
Parents: 1e48b72
Author: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Authored: Mon Feb 26 10:12:44 2018 +0100
Committer: zentol <chesnay@apache.org>
Committed: Mon Mar 5 12:12:08 2018 +0100

----------------------------------------------------------------------
 .../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/7d1c6b44/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/7d1c6b44/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/7d1c6b44/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;
 		}


Mime
View raw message