public class ZooKeeperMultipleComponentLeaderElectionDriver extends Object implements MultipleComponentLeaderElectionDriver, org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.leader.LeaderLatchListener
MultipleComponentLeaderElectionDriver implementation.MultipleComponentLeaderElectionDriver.Listener| Constructor and Description |
|---|
ZooKeeperMultipleComponentLeaderElectionDriver(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework curatorFramework,
MultipleComponentLeaderElectionDriver.Listener leaderElectionListener) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the driver.
|
void |
deleteLeaderInformation(String leaderName)
Deletes the leader information for the given component.
|
boolean |
hasLeadership()
Returns whether the driver has currently leadership.
|
void |
isLeader() |
void |
notLeader() |
void |
publishLeaderInformation(String componentId,
LeaderInformation leaderInformation)
Publishes the leader information for the given component.
|
String |
toString() |
public ZooKeeperMultipleComponentLeaderElectionDriver(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework curatorFramework,
MultipleComponentLeaderElectionDriver.Listener leaderElectionListener)
throws Exception
Exceptionpublic void close()
throws Exception
MultipleComponentLeaderElectionDriverclose in interface MultipleComponentLeaderElectionDriverException - if closing this driver failspublic boolean hasLeadership()
MultipleComponentLeaderElectionDriverhasLeadership in interface MultipleComponentLeaderElectionDrivertrue if the driver has leadership, otherwise falsepublic void publishLeaderInformation(String componentId, LeaderInformation leaderInformation) throws Exception
MultipleComponentLeaderElectionDriverpublishLeaderInformation in interface MultipleComponentLeaderElectionDrivercomponentId - identifying the component for which to publish the leader informationleaderInformation - leader information of the respective componentException - if publishing failspublic void deleteLeaderInformation(String leaderName) throws Exception
MultipleComponentLeaderElectionDriverdeleteLeaderInformation in interface MultipleComponentLeaderElectionDriverleaderName - identifying the component for which to delete the leader informationException - if deleting failspublic void isLeader()
isLeader in interface org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.leader.LeaderLatchListenerpublic void notLeader()
notLeader in interface org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.leader.LeaderLatchListenerCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.