Xushaohong commented on code in PR #4128:
URL: https://github.com/apache/ozone/pull/4128#discussion_r1057646124


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsUtils.java:
##########
@@ -776,4 +790,90 @@ public static 
ContainerProtos.ContainerCommandResponseProto processForDebug(
 
     return msg;
   }
+
+  /**
+   * Use raft client to send admin request, transfer the leadership.
+   * If not isRandom, then use host to match the target leader.
+   * 1. Set priority and send setConfiguration request
+   * 2. Trigger transferLeadership API.
+   *
+   * @param server        the Raft server
+   * @param groupId       the Raft group Id
+   * @param host          the string of the host, should be IP:PORT format
+   * @param isRandom      whether to choose random follower as target leader
+   * @param curLeader     the current Raft leader
+   * @throws IOException
+   */
+  public static void transferRatisLeadership(RaftServer server,

Review Comment:
   Could you tell me why it would be more useful? The process is short-term and 
hence the LeadershipManager will be temporary. The cost of creating a such 
class is a bit wasting I think.



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