public class KubernetesLeaderRetrievalDriverFactory extends Object implements LeaderRetrievalDriverFactory
KubernetesLeaderRetrievalDriver
in single leader election
mode.Constructor and Description |
---|
KubernetesLeaderRetrievalDriverFactory(KubernetesConfigMapSharedWatcher configMapSharedWatcher,
Executor watchExecutor,
String configMapName,
String componentId) |
Modifier and Type | Method and Description |
---|---|
LeaderRetrievalDriver |
createLeaderRetrievalDriver(LeaderRetrievalEventHandler leaderEventHandler,
FatalErrorHandler fatalErrorHandler)
Create a specific
LeaderRetrievalDriver and start the necessary services. |
LeaderInformation |
extractLeaderInformation(KubernetesConfigMap configMap) |
public KubernetesLeaderRetrievalDriverFactory(KubernetesConfigMapSharedWatcher configMapSharedWatcher, Executor watchExecutor, String configMapName, String componentId)
public LeaderRetrievalDriver createLeaderRetrievalDriver(LeaderRetrievalEventHandler leaderEventHandler, FatalErrorHandler fatalErrorHandler)
LeaderRetrievalDriverFactory
LeaderRetrievalDriver
and start the necessary services. For
example, NodeCache in Zookeeper, ConfigMap watcher in Kubernetes. They could get the leader
information change events and need to notify the leader listener by LeaderRetrievalEventHandler
.createLeaderRetrievalDriver
in interface LeaderRetrievalDriverFactory
leaderEventHandler
- handler for the leader retrieval driver to notify leader change
events.fatalErrorHandler
- fatal error handlerpublic LeaderInformation extractLeaderInformation(KubernetesConfigMap configMap)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.