ZooKeeperMultipleComponentLeaderElectionDriver@Deprecated public class ZooKeeperLeaderElectionDriver extends Object implements LeaderElectionDriver, org.apache.flink.shaded.curator5.org.apache.curator.framework.recipes.leader.LeaderLatchListener
LeaderElectionDriver implementation for Zookeeper. The leading JobManager is elected
using ZooKeeper. The current leader's address as well as its leader session ID is published via
ZooKeeper.| 构造器和说明 |
|---|
ZooKeeperLeaderElectionDriver(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework client,
String path,
LeaderElectionEventHandler leaderElectionEventHandler,
org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler,
String leaderContenderDescription)
已过时。
Creates a ZooKeeperLeaderElectionDriver object.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
已过时。
Close the services used for leader election.
|
boolean |
hasLeadership()
已过时。
Check whether the driver still have the leadership in the distributed coordination system.
|
void |
isLeader()
已过时。
|
void |
notLeader()
已过时。
|
String |
toString()
已过时。
|
void |
writeLeaderInformation(LeaderInformation leaderInformation)
已过时。
Writes the current leader's address as well the given leader session ID to ZooKeeper.
|
public ZooKeeperLeaderElectionDriver(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework client,
String path,
LeaderElectionEventHandler leaderElectionEventHandler,
org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler,
String leaderContenderDescription)
throws Exception
client - Client which is connected to the ZooKeeper quorumpath - ZooKeeper node path for the leader electionleaderElectionEventHandler - Event handler for processing leader change eventsfatalErrorHandler - Fatal error handlerleaderContenderDescription - Leader contender descriptionExceptionpublic void close()
throws Exception
LeaderElectionDriverclose 在接口中 LeaderElectionDriverExceptionpublic boolean hasLeadership()
LeaderElectionDriverhasLeadership 在接口中 LeaderElectionDriverpublic 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.LeaderLatchListenerpublic void writeLeaderInformation(LeaderInformation leaderInformation)
writeLeaderInformation 在接口中 LeaderElectionDriverleaderInformation - current leader information. It could be LeaderInformation.empty(), which means the caller want to clear the leader information
on external storage. Please remember that the clear operation should only happen before a
new leader is elected and has written his leader information on the storage. Otherwise,
we may have a risk to wrongly update the storage with empty leader information.Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.