Skip to content

Conversation

@tillrohrmann
Copy link
Contributor

What is the purpose of the change

Replace Flink's future with Java 8's CompletableFuture in RegisteredRpcConnection.

This PR is based on #4429.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

}
}, executor);

// this future should only ever fail if there is a bug, not if the registration is declined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could keep this comment, or is it no longer valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I will re-add it.


future.whenCompleteAsync(
(Tuple2<Gateway, Success> result, Throwable failure) -> {
if (failure != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether we should revert the condition so that the "successful" path comes first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I somehow like the failure case treating being first. It something like a termination condition for recursion, you also start with it instead of the recursion step.

…mpletableFuture conversion

Add DirectExecutionContext

Add Scala Future to Java 8 CompletableFuture utility to FutureUtils

Add Flink future to Java 8's CompletableFuture conversion utility to FutureUtils

Add base class for Flink's unchecked future exceptions
@tillrohrmann tillrohrmann force-pushed the rfRegisteredRpcConnection branch from f20a4a0 to 918df75 Compare August 1, 2017 08:07
@tillrohrmann
Copy link
Contributor Author

Thanks for your review @zentol. Addressed your comment and merging this PR now.

@asfgit asfgit closed this in fcac882 Aug 1, 2017
@tillrohrmann tillrohrmann deleted the rfRegisteredRpcConnection branch August 3, 2017 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants