flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7326) Remove Flink's futures from RegisteredRpcConnection
Date Mon, 31 Jul 2017 18:52:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-7326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16107770#comment-16107770
] 

ASF GitHub Bot commented on FLINK-7326:
---------------------------------------

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

    https://github.com/apache/flink/pull/4440#discussion_r130429986
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/registration/RegisteredRpcConnection.java
---
    @@ -88,24 +86,17 @@ public void start() {
     		pendingRegistration = checkNotNull(generateRegistration());
     		pendingRegistration.startRegistration();
     
    -		Future<Tuple2<Gateway, Success>> future = pendingRegistration.getFuture();
    -
    -		Future<Void> registrationSuccessFuture = future.thenAcceptAsync(new AcceptFunction<Tuple2<Gateway,
Success>>() {
    -			@Override
    -			public void accept(Tuple2<Gateway, Success> result) {
    -				targetGateway = result.f0;
    -				onRegistrationSuccess(result.f1);
    -			}
    -		}, executor);
    -
    -		// this future should only ever fail if there is a bug, not if the registration is
declined
    -		registrationSuccessFuture.exceptionallyAsync(new ApplyFunction<Throwable, Void>()
{
    -			@Override
    -			public Void apply(Throwable failure) {
    -				onRegistrationFailure(failure);
    -				return null;
    -			}
    -		}, executor);
    +		CompletableFuture<Tuple2<Gateway, Success>> future = pendingRegistration.getFuture();
    +
    +		future.whenCompleteAsync(
    +			(Tuple2<Gateway, Success> result, Throwable failure) -> {
    +				if (failure != null) {
    --- End diff --
    
    I'm wondering whether we should revert the condition so that the "successful" path comes
first.


> Remove Flink's futures from RegisteredRpcConnection
> ---------------------------------------------------
>
>                 Key: FLINK-7326
>                 URL: https://issues.apache.org/jira/browse/FLINK-7326
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Distributed Coordination
>    Affects Versions: 1.4.0
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
>            Priority: Minor
>             Fix For: 1.4.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message