Aitozi commented on a change in pull request #17053:
URL: https://github.com/apache/flink/pull/17053#discussion_r701214500
##########
File path:
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
##########
@@ -184,12 +184,32 @@ public RestClusterClient(
T clusterId,
WaitStrategy waitStrategy)
throws Exception {
- this(
- configuration,
- restClient,
- clusterId,
- waitStrategy,
-
HighAvailabilityServicesUtils.createClientHAService(configuration));
+ this.configuration = checkNotNull(configuration);
+
+ this.restClusterClientConfiguration =
+
RestClusterClientConfiguration.fromConfiguration(configuration);
+
+ if (restClient != null) {
+ this.restClient = restClient;
+ } else {
+ this.restClient = new RestClient(configuration, executorService);
+ }
+
+ this.waitStrategy = checkNotNull(waitStrategy);
+ this.clusterId = checkNotNull(clusterId);
+
+ this.clientHAServices =
+ HighAvailabilityServicesUtils.createClientHAService(
+ configuration,
+ exception ->
+ webMonitorLeaderRetriever.handleError(
+ new FlinkException(exception)));
+
+ this.webMonitorRetrievalService =
clientHAServices.getClusterRestEndpointLeaderRetriever();
+ this.retryExecutorService =
+ Executors.newSingleThreadScheduledExecutor(
+ new
ExecutorThreadFactory("Flink-RestClusterClient-Retry"));
+ startLeaderRetrievers();
Review comment:
Maybe I can use an `ClientHighAvailabilityServicesFactory` here to
decouple the `RestClusterClient` with concrete `ClientHighAvailabilityServices`
--
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]