Class RetryingRegistration<F extends Serializable,G extends RpcGateway,S extends RegistrationResponse.Success,R extends RegistrationResponse.Rejection>
- java.lang.Object
-
- org.apache.flink.runtime.registration.RetryingRegistration<F,G,S,R>
-
- Type Parameters:
F
- The type of the fencing tokenG
- The type of the gateway to connect to.S
- The type of the successful registration responses.R
- The type of the registration rejection responses.
public abstract class RetryingRegistration<F extends Serializable,G extends RpcGateway,S extends RegistrationResponse.Success,R extends RegistrationResponse.Rejection> extends Object
This utility class implements the basis of registering one component at another component, for example registering the TaskExecutor at the ResourceManager. ThisRetryingRegistration
implements both the initial address resolution and the retries-with-backoff strategy.The registration gives access to a future that is completed upon successful registration. The registration can be canceled, for example when the target where it tries to register at loses leader status.
-
-
Constructor Summary
Constructors Constructor Description RetryingRegistration(org.slf4j.Logger log, RpcService rpcService, String targetName, Class<G> targetType, String targetAddress, F fencingToken, RetryingRegistrationConfiguration retryingRegistrationConfiguration)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancels the registration procedure.CompletableFuture<org.apache.flink.runtime.registration.RetryingRegistration.RetryingRegistrationResult<G,S,R>>
getFuture()
protected abstract CompletableFuture<RegistrationResponse>
invokeRegistration(G gateway, F fencingToken, long timeoutMillis)
boolean
isCanceled()
Checks if the registration was canceled.void
startRegistration()
This method resolves the target address to a callable gateway and starts the registration after that.
-
-
-
Constructor Detail
-
RetryingRegistration
public RetryingRegistration(org.slf4j.Logger log, RpcService rpcService, String targetName, Class<G> targetType, String targetAddress, F fencingToken, RetryingRegistrationConfiguration retryingRegistrationConfiguration)
-
-
Method Detail
-
getFuture
public CompletableFuture<org.apache.flink.runtime.registration.RetryingRegistration.RetryingRegistrationResult<G,S,R>> getFuture()
-
cancel
public void cancel()
Cancels the registration procedure.
-
isCanceled
public boolean isCanceled()
Checks if the registration was canceled.- Returns:
- True if the registration was canceled, false otherwise.
-
invokeRegistration
protected abstract CompletableFuture<RegistrationResponse> invokeRegistration(G gateway, F fencingToken, long timeoutMillis) throws Exception
- Throws:
Exception
-
startRegistration
public void startRegistration()
This method resolves the target address to a callable gateway and starts the registration after that.
-
-