public class ZooKeeperMultipleComponentLeaderElectionDriver extends Object implements MultipleComponentLeaderElectionDriver, org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.leader.LeaderLatchListener
MultipleComponentLeaderElectionDriver implementation.MultipleComponentLeaderElectionDriver.Listener| 构造器和说明 |
|---|
ZooKeeperMultipleComponentLeaderElectionDriver(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework curatorFramework,
MultipleComponentLeaderElectionDriver.Listener leaderElectionListener) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 MultipleComponentLeaderElectionDriverException - if closing this driver failspublic boolean hasLeadership()
MultipleComponentLeaderElectionDriverhasLeadership 在接口中 MultipleComponentLeaderElectionDrivertrue if the driver has leadership, otherwise falsepublic void publishLeaderInformation(String componentId, LeaderInformation leaderInformation) throws Exception
MultipleComponentLeaderElectionDriverpublishLeaderInformation 在接口中 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 在接口中 MultipleComponentLeaderElectionDriverleaderName - identifying the component for which to delete the leader informationException - if deleting failspublic void isLeader()
isLeader 在接口中 org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.leader.LeaderLatchListenerpublic void notLeader()
notLeader 在接口中 org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.leader.LeaderLatchListenerCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.