You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/11/21 06:03:25 UTC

[GitHub] [hadoop-ozone] smengcl commented on a change in pull request #137: HDDS-2455. Implement MiniOzoneHAClusterImpl#getOMLeader

smengcl commented on a change in pull request #137: HDDS-2455. Implement MiniOzoneHAClusterImpl#getOMLeader
URL: https://github.com/apache/hadoop-ozone/pull/137#discussion_r348906923
 
 

 ##########
 File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java
 ##########
 @@ -118,6 +118,19 @@ public OzoneManager getOzoneManager(String omNodeId) {
     return this.ozoneManagerMap.get(omNodeId);
   }
 
+  /**
+   * Get OzoneManager leader object.
+   * @return OzoneManager object, could return null if there isn't a leader.
+   */
+  public OzoneManager getOMLeader() {
+    for (OzoneManager ozoneManager : this.ozoneManagers) {
+      if (ozoneManager.isLeader()) {
+        return ozoneManager;
+      }
 
 Review comment:
   Indeed this could be a problem. I talked to Arpit about this. It turns out there could be two OMs asserting themselves are both leaders in a short while, or there could be no leader. I will update this method to handle those two cases to some extent.

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


With regards,
Apache Git Services

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