nandakumar131 commented on a change in pull request #313: HDDS-2242. Avoid 
unnecessary rpc needed to discover the pipeline leader.
URL: https://github.com/apache/hadoop-ozone/pull/313#discussion_r355463573
 
 

 ##########
 File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/pipeline/Pipeline.java
 ##########
 @@ -132,6 +133,25 @@ void setLeaderId(UUID leaderId) {
     return new ArrayList<>(nodeStatus.keySet());
   }
 
+  /**
+   * Returns the leader if found else defaults to closest node.
+   *
+   * @return {@link DatanodeDetails}
+   */
+  public DatanodeDetails getLeaderNodeIfPresent() throws IOException {
 
 Review comment:
   We can rename this to `getLeader`, the javadoc already describes the 
behavior if the leader is not set. Ideally, the leader should be set in a 
pipeline.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to