public class ZooKeeperLeaderElectionDriver extends Object implements LeaderElectionDriver, org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.leader.LeaderLatchListener
LeaderElectionDriver implementation.LeaderElectionDriver.Listener| 构造器和说明 |
|---|
ZooKeeperLeaderElectionDriver(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework curatorFramework,
LeaderElectionDriver.Listener leaderElectionListener) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
deleteLeaderInformation(String componentId)
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 ZooKeeperLeaderElectionDriver(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework curatorFramework,
LeaderElectionDriver.Listener leaderElectionListener)
throws Exception
Exceptionpublic void close()
throws Exception
close 在接口中 AutoCloseableExceptionpublic boolean hasLeadership()
LeaderElectionDriverhasLeadership 在接口中 LeaderElectionDrivertrue if the driver has leadership, otherwise falsepublic void publishLeaderInformation(String componentId, LeaderInformation leaderInformation)
LeaderElectionDriverpublishLeaderInformation 在接口中 LeaderElectionDrivercomponentId - identifying the component for which to publish the leader informationleaderInformation - leader information of the respective componentpublic void deleteLeaderInformation(String componentId)
LeaderElectionDriverdeleteLeaderInformation 在接口中 LeaderElectionDrivercomponentId - identifying the component for which to delete the leader informationpublic 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–2024 The Apache Software Foundation. All rights reserved.