use of org.apache.flink.kubernetes.kubeclient.resources.KubernetesException in project flink by apache.
the class KubernetesMultipleComponentLeaderElectionDriver method hasLeadership.
@Override
public boolean hasLeadership() {
Preconditions.checkState(running.get());
final Optional<KubernetesConfigMap> optionalConfigMap = kubeClient.getConfigMap(configMapName);
if (optionalConfigMap.isPresent()) {
return KubernetesLeaderElector.hasLeadership(optionalConfigMap.get(), lockIdentity);
} else {
fatalErrorHandler.onFatalError(new KubernetesException(String.format("ConfigMap %s does not exist. This indicates that somebody has interfered with Flink's operation.", configMapName)));
return false;
}
}
Aggregations