F
- The type of the fencing tokenG
- The type of the gateway to connect to.S
- The type of the successful registration responses.public abstract class RegisteredRpcConnection<F extends Serializable,G extends RpcGateway,S 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,
F fencingToken,
Executor executor) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close connection.
|
protected abstract RetryingRegistration<F,G,S> |
generateRegistration()
This method generate a specific Registration, for example TaskExecutor Registration at the ResourceManager.
|
String |
getTargetAddress() |
G |
getTargetGateway()
Gets the RegisteredGateway.
|
F |
getTargetLeaderId() |
boolean |
isClosed() |
boolean |
isConnected() |
protected abstract void |
onRegistrationFailure(Throwable failure)
This method handle the Registration failure.
|
protected abstract void |
onRegistrationSuccess(S success)
This method handle the Registration Response.
|
void |
start() |
String |
toString() |
boolean |
tryReconnect() |
protected final org.slf4j.Logger log
public void start()
public boolean tryReconnect()
protected abstract RetryingRegistration<F,G,S> generateRegistration()
protected abstract void onRegistrationSuccess(S success)
protected abstract void onRegistrationFailure(Throwable failure)
public void close()
public boolean isClosed()
public F getTargetLeaderId()
public String getTargetAddress()
public G getTargetGateway()
public boolean isConnected()
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.