tillrohrmann commented on a change in pull request #17053:
URL: https://github.com/apache/flink/pull/17053#discussion_r701730081



##########
File path: 
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesClusterDescriptor.java
##########
@@ -113,7 +116,16 @@ public String getClusterDescription() {
                 return new RestClusterClient<>(
                         configuration,
                         clusterId,
-                        new 
StandaloneClientHAServices(getWebMonitorAddress(configuration)));
+                        new ClientHighAvailabilityServicesFactory() {
+                            @Override
+                            public ClientHighAvailabilityServices create(
+                                    Configuration configuration,
+                                    FatalErrorHandler fatalErrorHandler)
+                                    throws Exception {
+                                return new StandaloneClientHAServices(
+                                        getWebMonitorAddress(configuration));
+                            }

Review comment:
       Same here probably.

##########
File path: 
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
##########
@@ -214,7 +216,19 @@ private RestClusterClient(
         this.waitStrategy = checkNotNull(waitStrategy);
         this.clusterId = checkNotNull(clusterId);
 
-        this.clientHAServices = checkNotNull(clientHAServices);
+        this.clientHAServices =
+                clientHAServicesFactory.create(
+                        configuration,
+                        new FatalErrorHandler() {
+                            @Override
+                            public void onFatalError(Throwable exception) {
+                                webMonitorLeaderRetriever.handleError(
+                                        new FlinkException(
+                                                "Fatal error happened with 
client HA "
+                                                        + "services.",
+                                                exception));
+                            }

Review comment:
       I'd still use a lambda for a bit less boilerplate here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to