Gateway
- The type of the gateway to connect to.Success
- The type of the successful registration responses.public abstract class RetryingRegistration<Gateway extends RpcGateway,Success extends RegistrationResponse.Success> extends Object
RetryingRegistration
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 looses leader status.
Constructor and Description |
---|
RetryingRegistration(org.slf4j.Logger log,
RpcService rpcService,
String targetName,
Class<Gateway> targetType,
String targetAddress,
UUID leaderId) |
RetryingRegistration(org.slf4j.Logger log,
RpcService rpcService,
String targetName,
Class<Gateway> targetType,
String targetAddress,
UUID leaderId,
long initialRegistrationTimeout,
long maxRegistrationTimeout,
long delayOnError,
long delayOnRefusedRegistration) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the registration procedure.
|
Future<Tuple2<Gateway,Success>> |
getFuture() |
protected abstract Future<RegistrationResponse> |
invokeRegistration(Gateway gateway,
UUID leaderId,
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.
|
public RetryingRegistration(org.slf4j.Logger log, RpcService rpcService, String targetName, Class<Gateway> targetType, String targetAddress, UUID leaderId)
public void cancel()
public boolean isCanceled()
protected abstract Future<RegistrationResponse> invokeRegistration(Gateway gateway, UUID leaderId, long timeoutMillis) throws Exception
Exception
public void startRegistration()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.