Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4462#discussion_r130873887
  
    --- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/rpc/TestingRpcService.java 
---
    @@ -92,20 +92,19 @@ public void registerGateway(String address, RpcGateway 
gateway) {
        }
     
        @Override
    -   public <C extends RpcGateway> Future<C> connect(String address, 
Class<C> clazz) {
    +   public <C extends RpcGateway> CompletableFuture<C> connect(String 
address, Class<C> clazz) {
                RpcGateway gateway = registeredConnections.get(address);
     
                if (gateway != null) {
                        if (clazz.isAssignableFrom(gateway.getClass())) {
                                @SuppressWarnings("unchecked")
                                C typedGateway = (C) gateway;
    -                           return 
FlinkCompletableFuture.completed(typedGateway);
    +                           return 
CompletableFuture.completedFuture(typedGateway);
                        } else {
    -                           return 
FlinkCompletableFuture.completedExceptionally(
    -                                   new Exception("Gateway registered under 
" + address + " is not of type " + clazz));
    +                           return FutureUtils.completedExceptionally(new 
Exception("Gateway registered under " + address + " is not of type " + clazz));
                        }
                } else {
    -                   return 
FlinkCompletableFuture.completedExceptionally(new Exception("No gateway 
registered under that name"));
    +                   return FutureUtils.completedExceptionally(new 
Exception("No gateway registered under that name"));
    --- End diff --
    
    We could include the name in the exception.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to