Class ZooKeeperLeaderElectionDriverFactory
java.lang.Object
org.apache.flink.runtime.leaderelection.ZooKeeperLeaderElectionDriverFactory
- All Implemented Interfaces:
LeaderElectionDriverFactory
public class ZooKeeperLeaderElectionDriverFactory
extends Object
implements LeaderElectionDriverFactory
Factory for
ZooKeeperLeaderElectionDriver.-
Constructor Summary
ConstructorsConstructorDescriptionZooKeeperLeaderElectionDriverFactory(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework curatorFramework) -
Method Summary
Modifier and TypeMethodDescriptioncreate(LeaderElectionDriver.Listener leaderElectionListener) Creates aLeaderElectionDriverfor the given leader contender description.
-
Constructor Details
-
ZooKeeperLeaderElectionDriverFactory
public ZooKeeperLeaderElectionDriverFactory(org.apache.flink.shaded.curator5.org.apache.curator.framework.CuratorFramework curatorFramework)
-
-
Method Details
-
create
public ZooKeeperLeaderElectionDriver create(LeaderElectionDriver.Listener leaderElectionListener) throws Exception Description copied from interface:LeaderElectionDriverFactoryCreates aLeaderElectionDriverfor the given leader contender description. Moreover, it registers the given leader election listener with the service.- Specified by:
createin interfaceLeaderElectionDriverFactory- Parameters:
leaderElectionListener- listener for the callbacks of theLeaderElectionDriver- Returns:
- created
LeaderElectionDriverinstance - Throws:
Exception- if the creation fails
-