Class ZooKeeperLeaderRetrievalDriver
- java.lang.Object
-
- org.apache.flink.runtime.leaderretrieval.ZooKeeperLeaderRetrievalDriver
-
- All Implemented Interfaces:
AutoCloseable,LeaderRetrievalDriver
public class ZooKeeperLeaderRetrievalDriver extends Object implements LeaderRetrievalDriver
The counterpart to theZooKeeperLeaderElectionDriver.LeaderRetrievalServiceimplementation for Zookeeper. It retrieves the current leader which has been elected by theZooKeeperLeaderElectionDriver. The leader address as well as the current leader session ID is retrieved from ZooKeeper.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZooKeeperLeaderRetrievalDriver.LeaderInformationClearancePolicyPolicy when to clear the leader information and to notify the listener about it.
-
Constructor Summary
Constructors Constructor Description ZooKeeperLeaderRetrievalDriver(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework client, String path, LeaderRetrievalEventHandler leaderRetrievalEventHandler, ZooKeeperLeaderRetrievalDriver.LeaderInformationClearancePolicy leaderInformationClearancePolicy, org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler)Creates a leader retrieval service which uses ZooKeeper to retrieve the leader information.
-
-
-
Constructor Detail
-
ZooKeeperLeaderRetrievalDriver
public ZooKeeperLeaderRetrievalDriver(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework client, String path, LeaderRetrievalEventHandler leaderRetrievalEventHandler, ZooKeeperLeaderRetrievalDriver.LeaderInformationClearancePolicy leaderInformationClearancePolicy, org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler) throws ExceptionCreates a leader retrieval service which uses ZooKeeper to retrieve the leader information.- Parameters:
client- Client which constitutes the connection to the ZooKeeper quorumpath- Path of the ZooKeeper node which contains the leader informationleaderRetrievalEventHandler- Handler to notify the leader changes.leaderInformationClearancePolicy- leaderInformationClearancePolicy controls when the leader information is being clearedfatalErrorHandler- Fatal error handler- Throws:
Exception
-
-