public class KubernetesLeaderElectionDriver extends Object implements LeaderElectionDriver
LeaderElectionDriver
for Kubernetes.LeaderElectionDriver.Listener
Constructor and Description |
---|
KubernetesLeaderElectionDriver(KubernetesLeaderElectionConfiguration leaderElectionConfiguration,
FlinkKubeClient kubeClient,
LeaderElectionDriver.Listener leaderElectionListener,
KubernetesConfigMapSharedWatcher configMapSharedWatcher,
Executor watchExecutor) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
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.
|
String |
toString() |
public KubernetesLeaderElectionDriver(KubernetesLeaderElectionConfiguration leaderElectionConfiguration, FlinkKubeClient kubeClient, LeaderElectionDriver.Listener leaderElectionListener, KubernetesConfigMapSharedWatcher configMapSharedWatcher, Executor watchExecutor)
public void close() throws Exception
close
in interface AutoCloseable
Exception
public boolean hasLeadership()
LeaderElectionDriver
hasLeadership
in interface LeaderElectionDriver
true
if the driver has leadership, otherwise false
public void publishLeaderInformation(String componentId, LeaderInformation leaderInformation)
LeaderElectionDriver
publishLeaderInformation
in interface LeaderElectionDriver
componentId
- identifying the component for which to publish the leader informationleaderInformation
- leader information of the respective componentpublic void deleteLeaderInformation(String componentId)
LeaderElectionDriver
deleteLeaderInformation
in interface LeaderElectionDriver
componentId
- identifying the component for which to delete the leader informationCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.