dombizita commented on code in PR #4054:
URL: https://github.com/apache/ozone/pull/4054#discussion_r1045688841


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java:
##########
@@ -697,6 +698,28 @@ public Map<String, Integer> getPipelineInfo() throws 
NotLeaderException {
     return pipelineInfo;
   }
 
+  @Override
+  public Map<String, String[]> getPipelineLeaders() throws NotLeaderException {
+    final Map<String, String[]> pipelineInfo = new HashMap<>();
+    List<Pipeline> pipelines = getPipelines();
+    pipelines.forEach(pipeline -> {
+      String leaderNode = "";
+      UUID pipelineId = pipeline.getId().getId();
+
+      try {
+        leaderNode = pipeline.getLeaderNode().getHostName();

Review Comment:
   I know that for users the datanode hostname would be more informative, but 
as I looked into it in the 
[DatanodeDetails](https://github.com/apache/ozone/blob/c7038e08a8df296108280f3759be55e7cbbf1d78/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java)
 class only the UUID is unique, based on this [code 
snippet](https://github.com/apache/ozone/blob/c7038e08a8df296108280f3759be55e7cbbf1d78/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java#L509L523).
 Maybe we should use that here or add both?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to