1996fanrui commented on code in PR #20232:
URL: https://github.com/apache/flink/pull/20232#discussion_r1315711282


##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManagerLocation.java:
##########
@@ -275,6 +275,15 @@ public static String getHostName(InetAddress inetAddress) {
         return hostName;
     }
 
+    /**
+     * Gets the location string of the TaskManager in the format of 
"$HOST:$PORT".
+     *
+     * @return The location string of the TaskManager.
+     */
+    public String getLocationString() {

Review Comment:
   Could you help add some tests for this method?



##########
flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/SubtaskExecutionAttemptDetailsInfo.java:
##########
@@ -203,7 +203,8 @@ public static SubtaskExecutionAttemptDetailsInfo create(
         final long now = System.currentTimeMillis();
 
         final TaskManagerLocation location = 
execution.getAssignedResourceLocation();
-        final String locationString = location == null ? "(unassigned)" : 
location.getHostname();
+        final String locationString =
+                location == null ? "(unassigned)" : 
location.getLocationString();

Review Comment:
   The `SubtaskExecutionAttemptDetailsInfo#host` should rename, right?
   
   Also, the `SubtaskExecutionAttemptDetailsInfo#FIELD_NAME_HOST` and the 
front-end should be renamed  as well. However, I'm not sure whether the 
interface is called by flink users. If yes, the change is incompatible.Should 
we adding an extra field to store the locationString? 
   
   Anyway, using the `host` to store `locationString` for rest api does't make 
sense.



##########
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobVertexTaskManagersHandler.java:
##########
@@ -142,9 +142,7 @@ private static JobVertexTaskManagersInfo 
createJobVertexTaskManagersInfo(
             for (AccessExecution execution : vertex.getCurrentExecutions()) {
                 TaskManagerLocation location = 
execution.getAssignedResourceLocation();
                 String taskManagerHost =

Review Comment:
   ```suggestion
                   String locationString =
   ```
   
   how about this?



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

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to