public class

ZkHelixLeaderElection

extends Object
implements ControllerChangeListener
java.lang.Object
   ↳ org.apache.helix.manager.zk.ZkHelixLeaderElection

Summary

Public Constructors
ZkHelixLeaderElection(ZkHelixController controller, GenericHelixController pipeline)
Public Methods
synchronized void onControllerChange(NotificationContext changeContext)
may be accessed by multiple threads: zk-client thread and ZkHelixManager.disconnect()->reset() TODO: Refactor accessing HelixMangerMain class statically
static boolean tryUpdateController(HelixManager manager)
Try to become the leader controller
static void updateHistory(HelixManager manager)
Update the history with this controller as the most recent leader
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.helix.ControllerChangeListener

Public Constructors

public ZkHelixLeaderElection (ZkHelixController controller, GenericHelixController pipeline)

Public Methods

public synchronized void onControllerChange (NotificationContext changeContext)

may be accessed by multiple threads: zk-client thread and ZkHelixManager.disconnect()->reset() TODO: Refactor accessing HelixMangerMain class statically

Parameters
changeContext description of the event and state

public static boolean tryUpdateController (HelixManager manager)

Try to become the leader controller

Parameters
manager a live helix manager connection
Returns
  • true if this controller has been elected the leader, false otherwise

public static void updateHistory (HelixManager manager)

Update the history with this controller as the most recent leader

Parameters
manager active helix manager connection