You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2019/02/26 19:36:31 UTC

[GitHub] HeartSaVioR commented on a change in pull request #2945: STORM-3321: Fix race in LocalCluster regarding Nimbus leadership, red…

HeartSaVioR commented on a change in pull request #2945: STORM-3321: Fix race in LocalCluster regarding Nimbus leadership, red…
URL: https://github.com/apache/storm/pull/2945#discussion_r260451686
 
 

 ##########
 File path: storm-client/src/jvm/org/apache/storm/nimbus/ILeaderElector.java
 ##########
 @@ -52,6 +54,15 @@
      * @return the current leader's address , may return null if no one has the lock.
      */
     NimbusInfo getLeader();
+    
+    /**
+     * Wait for the caller to gain leadership. This should only be used in single-Nimbus clusters, and is only useful to allow testing
+     * code to wait for a LocalCluster's Nimbus to gain leadership before trying to submit topologies.
+     *
+     * @return true is leadership was acquired, false otherwise
+     */
+    @VisibleForTesting
+    boolean awaitLeadership(long timeout, TimeUnit timeUnit) throws InterruptedException;
 
 Review comment:
   I assume we don't think ILeaderElector as user facing (public) API so don't mind about backward compatibility.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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