Gateway
- The type of the gateway to connect to.Success
- The type of the successful registration responses.public abstract class RegisteredRpcConnection<Gateway extends RpcGateway,Success extends RegistrationResponse.Success> extends Object
RegisteredRpcConnection
implements registration and get target gateway.
The registration gives access to a future that is completed upon successful registration. The RPC connection can be closed, for example when the target where it tries to register at looses leader status.
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log
the logger for all log messages of this class
|
Constructor and Description |
---|
RegisteredRpcConnection(org.slf4j.Logger log,
String targetAddress,
UUID targetLeaderId,
Executor executor) |
Modifier and Type | Method and Description |
---|---|
void |
close()
close connection
|
protected abstract RetryingRegistration<Gateway,Success> |
generateRegistration()
This method generate a specific Registration, for example TaskExecutor Registration at the ResourceManager
|
String |
getTargetAddress() |
Gateway |
getTargetGateway()
Gets the RegisteredGateway.
|
UUID |
getTargetLeaderId() |
boolean |
isClosed() |
boolean |
isConnected() |
protected abstract void |
onRegistrationFailure(Throwable failure)
This method handle the Registration failure
|
protected abstract void |
onRegistrationSuccess(Success success)
This method handle the Registration Response
|
void |
start() |
String |
toString() |
public void start()
protected abstract RetryingRegistration<Gateway,Success> generateRegistration()
protected abstract void onRegistrationSuccess(Success success)
protected abstract void onRegistrationFailure(Throwable failure)
public void close()
public boolean isClosed()
public UUID getTargetLeaderId()
public String getTargetAddress()
public Gateway getTargetGateway()
public boolean isConnected()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.