public class KubernetesMultipleComponentLeaderElectionDriver extends Object implements MultipleComponentLeaderElectionDriver
MultipleComponentLeaderElectionDriver
for Kubernetes.MultipleComponentLeaderElectionDriver.Listener
Constructor and Description |
---|
KubernetesMultipleComponentLeaderElectionDriver(KubernetesLeaderElectionConfiguration leaderElectionConfiguration,
FlinkKubeClient kubeClient,
MultipleComponentLeaderElectionDriver.Listener leaderElectionListener,
KubernetesConfigMapSharedWatcher configMapSharedWatcher,
Executor watchExecutor,
FatalErrorHandler fatalErrorHandler) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the driver.
|
void |
deleteLeaderInformation(String componentId)
Deletes the leader information for the given component.
|
boolean |
hasLeadership()
Returns whether the driver has currently leadership.
|
void |
publishLeaderInformation(String componentId,
LeaderInformation leaderInformation)
Publishes the leader information for the given component.
|
public KubernetesMultipleComponentLeaderElectionDriver(KubernetesLeaderElectionConfiguration leaderElectionConfiguration, FlinkKubeClient kubeClient, MultipleComponentLeaderElectionDriver.Listener leaderElectionListener, KubernetesConfigMapSharedWatcher configMapSharedWatcher, Executor watchExecutor, FatalErrorHandler fatalErrorHandler)
public void close() throws Exception
MultipleComponentLeaderElectionDriver
close
in interface MultipleComponentLeaderElectionDriver
Exception
- if closing this driver failspublic boolean hasLeadership()
MultipleComponentLeaderElectionDriver
hasLeadership
in interface MultipleComponentLeaderElectionDriver
true
if the driver has leadership, otherwise false
public void publishLeaderInformation(String componentId, LeaderInformation leaderInformation) throws Exception
MultipleComponentLeaderElectionDriver
publishLeaderInformation
in interface MultipleComponentLeaderElectionDriver
componentId
- identifying the component for which to publish the leader informationleaderInformation
- leader information of the respective componentException
- if publishing failspublic void deleteLeaderInformation(String componentId) throws Exception
MultipleComponentLeaderElectionDriver
deleteLeaderInformation
in interface MultipleComponentLeaderElectionDriver
componentId
- identifying the component for which to delete the leader informationException
- if deleting failsCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.