jinglining commented on a change in pull request #9555: [FLINK-13868][REST] Job 
vertex add taskmanager id in rest api
URL: https://github.com/apache/flink/pull/9555#discussion_r320214617
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobVertexDetailsHandler.java
 ##########
 @@ -107,47 +105,16 @@ protected JobVertexDetailsInfo handleRequest(
        }
 
        private static JobVertexDetailsInfo 
createJobVertexDetailsInfo(AccessExecutionJobVertex jobVertex, JobID jobID, 
@Nullable MetricFetcher metricFetcher) {
-               List<JobVertexDetailsInfo.VertexTaskDetail> subtasks = new 
ArrayList<>();
+               List<SubtaskExecutionAttemptDetailsInfo> subtasks = new 
ArrayList<>();
                final long now = System.currentTimeMillis();
-               int num = 0;
                for (AccessExecutionVertex vertex : 
jobVertex.getTaskVertices()) {
-                       final ExecutionState status = 
vertex.getExecutionState();
-
-                       TaskManagerLocation location = 
vertex.getCurrentAssignedResourceLocation();
-                       String locationString = location == null ? 
"(unassigned)" : location.getHostname() + ":" + location.dataPort();
-
-                       long startTime = 
vertex.getStateTimestamp(ExecutionState.DEPLOYING);
-                       if (startTime == 0) {
-                               startTime = -1;
-                       }
-                       long endTime = status.isTerminal() ? 
vertex.getStateTimestamp(status) : -1;
-                       long duration = startTime > 0 ? ((endTime > 0 ? endTime 
: now) - startTime) : -1;
-
                        MutableIOMetrics counts = new MutableIOMetrics();
                        counts.addIOMetrics(
                                vertex.getCurrentExecutionAttempt(),
                                metricFetcher,
                                jobID.toString(),
                                jobVertex.getJobVertexId().toString());
-                       subtasks.add(new JobVertexDetailsInfo.VertexTaskDetail(
-                               num,
-                               status,
-                               
vertex.getCurrentExecutionAttempt().getAttemptNumber(),
-                               locationString,
-                               startTime,
-                               endTime,
-                               duration,
-                               new IOMetricsInfo(
-                                       counts.getNumBytesIn(),
-                                       counts.isNumBytesInComplete(),
-                                       counts.getNumBytesOut(),
-                                       counts.isNumBytesOutComplete(),
-                                       counts.getNumRecordsIn(),
-                                       counts.isNumRecordsInComplete(),
-                                       counts.getNumRecordsOut(),
-                                       counts.isNumRecordsOutComplete())));
-
-                       num++;
+                       
subtasks.add(SubtaskExecutionAttemptDetailsInfo.createDetailsInfo(vertex.getCurrentExecutionAttempt(),
 jobID, jobVertex.getJobVertexId(), metricFetcher));
 
 Review comment:
   Create new JIRA?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to