xintongsong commented on a change in pull request #15249:
URL: https://github.com/apache/flink/pull/15249#discussion_r598460972



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/taskmanager/TaskManagerDetailsHandler.java
##########
@@ -87,14 +87,14 @@ public TaskManagerDetailsHandler(
         final ResourceID taskManagerResourceId =
                 request.getPathParameter(TaskManagerIdPathParameter.class);
 
-        CompletableFuture<TaskManagerInfo> taskManagerInfoFuture =
-                gateway.requestTaskManagerInfo(taskManagerResourceId, timeout);
+        CompletableFuture<TaskManagerInfoWithSlots> 
taskManagerInfoWithSLotsFuture =

Review comment:
       ```suggestion
           CompletableFuture<TaskManagerInfoWithSlots> 
taskManagerInfoWithSlotsFuture =
   ```

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/taskmanager/TaskManagerDetailsInfo.java
##########
@@ -70,31 +80,39 @@ public TaskManagerDetailsInfo(
                 memoryConfiguration);
 
         this.taskManagerMetrics = 
Preconditions.checkNotNull(taskManagerMetrics);
+        this.allocatedSlots = Preconditions.checkNotNull(allocatedSlots);
     }
 
     public TaskManagerDetailsInfo(
-            TaskManagerInfo taskManagerInfo, TaskManagerMetricsInfo 
taskManagerMetrics) {
+            TaskManagerInfoWithSlots taskManagerInfoWithSlots,
+            TaskManagerMetricsInfo taskManagerMetrics) {
         this(
-                taskManagerInfo.getResourceId(),
-                taskManagerInfo.getAddress(),
-                taskManagerInfo.getDataPort(),
-                taskManagerInfo.getJmxPort(),
-                taskManagerInfo.getLastHeartbeat(),
-                taskManagerInfo.getNumberSlots(),
-                taskManagerInfo.getNumberAvailableSlots(),
-                taskManagerInfo.getTotalResource(),
-                taskManagerInfo.getFreeResource(),
-                taskManagerInfo.getHardwareDescription(),
-                taskManagerInfo.getMemoryConfiguration(),
+                taskManagerInfoWithSlots.getTaskManagerInfo().getResourceId(),
+                taskManagerInfoWithSlots.getTaskManagerInfo().getAddress(),
+                taskManagerInfoWithSlots.getTaskManagerInfo().getDataPort(),
+                taskManagerInfoWithSlots.getTaskManagerInfo().getJmxPort(),
+                
taskManagerInfoWithSlots.getTaskManagerInfo().getLastHeartbeat(),
+                taskManagerInfoWithSlots.getTaskManagerInfo().getNumberSlots(),
+                
taskManagerInfoWithSlots.getTaskManagerInfo().getNumberAvailableSlots(),
+                
taskManagerInfoWithSlots.getTaskManagerInfo().getTotalResource(),
+                
taskManagerInfoWithSlots.getTaskManagerInfo().getFreeResource(),
+                
taskManagerInfoWithSlots.getTaskManagerInfo().getHardwareDescription(),
+                
taskManagerInfoWithSlots.getTaskManagerInfo().getMemoryConfiguration(),
+                taskManagerInfoWithSlots.getAllocatedSlots(),
                 taskManagerMetrics);
     }
 
-    @JsonProperty(FIELD_NAME_METRICS)
+    @JsonIgnore

Review comment:
       This is a bit unrelated. We may consider to have this in a hotfix 
commit, together with properties in `TaskManagerInfo`.




-- 
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]


Reply via email to