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/27 08:30:20 UTC

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

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

 ##########
 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:
   No, I don't think this API is supposed to be used by anyone other than Nimbus.

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