tillrohrmann commented on a change in pull request #7725: [FLINK-11594][tests]
Remove TaskManagerRegistrationTest
URL: https://github.com/apache/flink/pull/7725#discussion_r257586485
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/registration/RetryingRegistration.java
##########
@@ -154,28 +137,28 @@ public void startRegistration() {
}
try {
- // trigger resolution of the resource manager address
to a callable gateway
- final CompletableFuture<G> resourceManagerFuture;
+ // trigger resolution of the target address to a
callable gateway
+ final CompletableFuture<G> rpcGatewayFuture;
if
(FencedRpcGateway.class.isAssignableFrom(targetType)) {
- resourceManagerFuture = (CompletableFuture<G>)
rpcService.connect(
+ rpcGatewayFuture = (CompletableFuture<G>)
rpcService.connect(
targetAddress,
fencingToken,
targetType.asSubclass(FencedRpcGateway.class));
} else {
- resourceManagerFuture =
rpcService.connect(targetAddress, targetType);
+ rpcGatewayFuture =
rpcService.connect(targetAddress, targetType);
}
// upon success, start the registration attempts
- CompletableFuture<Void> resourceManagerAcceptFuture =
resourceManagerFuture.thenAcceptAsync(
- (G result) -> {
+ CompletableFuture<Void> rpcGatewayAcceptFuture =
rpcGatewayFuture.thenAcceptAsync(
+ (G rpcGateway) -> {
log.info("Resolved {} address,
beginning registration", targetName);
- register(result, 1,
retryingRegistrationConfiguration.getInitialRegistrationTimeoutMillis());
+ register(rpcGateway, 1,
retryingRegistrationConfiguration.getInitialRegistrationTimeoutMillis());
},
rpcService.getExecutor());
// upon failure, retry, unless this is cancelled
- resourceManagerAcceptFuture.whenCompleteAsync(
+ rpcGatewayAcceptFuture.whenCompleteAsync(
(Void v, Throwable failure) -> {
if (failure != null && !canceled) {
final Throwable strippedFailure
= ExceptionUtils.stripCompletionException(failure);
Review comment:
Good refactorings!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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