public class ZooKeeperLeaderRetrievalDriver extends Object implements LeaderRetrievalDriver
ZooKeeperLeaderElectionDriver. LeaderRetrievalService
implementation for Zookeeper. It retrieves the current leader which has been elected by the
ZooKeeperLeaderElectionDriver. The leader address as well as the current leader session
ID is retrieved from ZooKeeper.| 限定符和类型 | 类和说明 |
|---|---|
static class |
ZooKeeperLeaderRetrievalDriver.LeaderInformationClearancePolicy
Policy when to clear the leader information and to notify the listener about it.
|
| 构造器和说明 |
|---|
ZooKeeperLeaderRetrievalDriver(org.apache.flink.shaded.curator4.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.
|
public ZooKeeperLeaderRetrievalDriver(org.apache.flink.shaded.curator4.org.apache.curator.framework.CuratorFramework client,
String path,
LeaderRetrievalEventHandler leaderRetrievalEventHandler,
ZooKeeperLeaderRetrievalDriver.LeaderInformationClearancePolicy leaderInformationClearancePolicy,
org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler)
throws Exception
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 handlerExceptionpublic void close()
throws Exception
LeaderRetrievalDriverclose 在接口中 LeaderRetrievalDriverException@VisibleForTesting public String getConnectionInformationPath()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.