tillrohrmann commented on a change in pull request #9630: [FLINK-13964] Let 
HighAvailabilityServices create cluster and client side HA services
URL: https://github.com/apache/flink/pull/9630#discussion_r321269376
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/HighAvailabilityServicesFactory.java
 ##########
 @@ -47,19 +46,6 @@
         * @throws Exception when ClientHAServices cannot be created
         */
        default ClientHighAvailabilityServices 
createClientHAServices(Configuration configuration) throws Exception {
-               return new ClientHighAvailabilityServices() {
-
-                       private HighAvailabilityServices haServices = 
createHAServices(configuration, Executors.directExecutor());
-
-                       @Override
-                       public LeaderRetrievalService 
getClusterRestEndpointLeaderRetriever() {
-                               return 
haServices.getWebMonitorLeaderRetriever();
-                       }
-
-                       @Override
-                       public void close() throws Exception {
-                               haServices.close();
-                       }
-               };
+               return createHAServices(configuration, 
UnsupportedOperationExecutor.INSTANCE);
 
 Review comment:
   The idea was to explicitly state that this executor should not be used by 
any of the client side services. At the moment this holds true. If in the 
future this should change, it will be visible due to the 
`UnsupportedOperationException`. Then one should think about introducing a 
proper `Executor` whose lifecycle is properly managed. This will most likely 
require changes to the `HighAvailabilityServicesFactory` because we need to 
pass it to the `#createClientHAServices` method.
   
   The reason why I would not like to pass `Executors.directExecutor()` or 
something else is that someone who changes that client side services don't use 
the `Executor` won't notice this because it won't fail. This might be 
problematic because he might execute blocking operations in the `Executor` for 
which the direct executor is not suitable.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to