Class KubernetesLeaderElectionDriver
- java.lang.Object
-
- org.apache.flink.kubernetes.highavailability.KubernetesLeaderElectionDriver
-
- All Implemented Interfaces:
AutoCloseable
,LeaderElectionDriver
public class KubernetesLeaderElectionDriver extends Object implements LeaderElectionDriver
LeaderElectionDriver
for Kubernetes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.leaderelection.LeaderElectionDriver
LeaderElectionDriver.Listener
-
-
Constructor Summary
Constructors Constructor Description KubernetesLeaderElectionDriver(KubernetesLeaderElectionConfiguration leaderElectionConfiguration, FlinkKubeClient kubeClient, LeaderElectionDriver.Listener leaderElectionListener, KubernetesConfigMapSharedWatcher configMapSharedWatcher, Executor watchExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Constructor Detail
-
KubernetesLeaderElectionDriver
public KubernetesLeaderElectionDriver(KubernetesLeaderElectionConfiguration leaderElectionConfiguration, FlinkKubeClient kubeClient, LeaderElectionDriver.Listener leaderElectionListener, KubernetesConfigMapSharedWatcher configMapSharedWatcher, Executor watchExecutor)
-
-
Method Detail
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
hasLeadership
public boolean hasLeadership()
Description copied from interface:LeaderElectionDriver
Returns whether the driver has currently leadership.- Specified by:
hasLeadership
in interfaceLeaderElectionDriver
- Returns:
true
if the driver has leadership, otherwisefalse
-
publishLeaderInformation
public void publishLeaderInformation(String componentId, LeaderInformation leaderInformation)
Description copied from interface:LeaderElectionDriver
Publishes the leader information for the given component.- Specified by:
publishLeaderInformation
in interfaceLeaderElectionDriver
- Parameters:
componentId
- identifying the component for which to publish the leader informationleaderInformation
- leader information of the respective component
-
deleteLeaderInformation
public void deleteLeaderInformation(String componentId)
Description copied from interface:LeaderElectionDriver
Deletes the leader information for the given component.- Specified by:
deleteLeaderInformation
in interfaceLeaderElectionDriver
- Parameters:
componentId
- identifying the component for which to delete the leader information
-
-