neils-dev commented on code in PR #3409:
URL: https://github.com/apache/ozone/pull/3409#discussion_r1105024511


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerRatisServer.java:
##########
@@ -807,6 +810,57 @@ public RaftPeerId getRaftPeerId() {
     return this.raftPeerId;
   }
 
+  @VisibleForTesting
+  public RaftPeerId getRaftLeaderId() {
+    return this.getRaftLeader() == null ? null : this.getRaftLeader().getId();
+  }
+
+  @VisibleForTesting
+  public String getRaftLeaderAddress() {
+    if (this.getRaftLeader() == null) {

Review Comment:
   Perhaps consider using a local variable to hold the `RaftPeer` with a single 
call to `getRaftLeader()` at beginning of method.  Then using this var through 
rest of method instead of repeated calls to `getRaftLeader()`.



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