public class StandardClusterCoordinationProtocolSender extends Object implements ClusterCoordinationProtocolSender
| Modifier and Type | Field and Description |
|---|---|
private int |
handshakeTimeoutSeconds |
private static org.slf4j.Logger |
logger |
private int |
maxThreadsPerRequest |
private ProtocolContext<ProtocolMessage> |
protocolContext |
private SocketConfiguration |
socketConfiguration |
| Constructor and Description |
|---|
StandardClusterCoordinationProtocolSender(SocketConfiguration socketConfiguration,
ProtocolContext<ProtocolMessage> protocolContext,
int maxThreadsPerRequest) |
| Modifier and Type | Method and Description |
|---|---|
private Socket |
createSocket(NodeIdentifier nodeId,
boolean applyHandshakeTimeout) |
private Socket |
createSocket(String host,
int port,
boolean applyHandshakeTimeout) |
void |
disconnect(DisconnectMessage msg)
Requests a node to disconnect from the cluster.
|
int |
getHandshakeTimeoutSeconds() |
SocketConfiguration |
getSocketConfiguration() |
void |
notifyNodeStatusChange(Set<NodeIdentifier> nodesToNotify,
NodeStatusChangeMessage msg)
Notifies all nodes in the given set that a node in the cluster has a new status
|
NodeConnectionStatus |
requestNodeConnectionStatus(String hostname,
int port)
Sends a request to the given hostname and port to request its connection status
|
ReconnectionResponseMessage |
requestReconnection(ReconnectionRequestMessage msg)
Requests a node to reconnect to the cluster.
|
void |
setBulletinRepository(BulletinRepository bulletinRepository)
Sets the
BulletinRepository that can be used to report bulletins |
private void |
setConnectionHandshakeTimeoutOnSocket(Socket socket) |
void |
setHandshakeTimeout(String handshakeTimeout) |
private static final org.slf4j.Logger logger
private final ProtocolContext<ProtocolMessage> protocolContext
private final SocketConfiguration socketConfiguration
private final int maxThreadsPerRequest
private int handshakeTimeoutSeconds
public StandardClusterCoordinationProtocolSender(SocketConfiguration socketConfiguration, ProtocolContext<ProtocolMessage> protocolContext, int maxThreadsPerRequest)
public void setBulletinRepository(BulletinRepository bulletinRepository)
ClusterCoordinationProtocolSenderBulletinRepository that can be used to report bulletinssetBulletinRepository in interface ClusterCoordinationProtocolSenderbulletinRepository - repopublic ReconnectionResponseMessage requestReconnection(ReconnectionRequestMessage msg) throws ProtocolException
requestReconnection in interface ClusterCoordinationProtocolSendermsg - a messageProtocolException - if the message failed to be sent or the
response was malformedpublic void disconnect(DisconnectMessage msg) throws ProtocolException
disconnect in interface ClusterCoordinationProtocolSendermsg - a messageProtocolException - if the message failed to be sentprivate void setConnectionHandshakeTimeoutOnSocket(Socket socket) throws SocketException
SocketExceptionpublic SocketConfiguration getSocketConfiguration()
public int getHandshakeTimeoutSeconds()
public void setHandshakeTimeout(String handshakeTimeout)
private Socket createSocket(NodeIdentifier nodeId, boolean applyHandshakeTimeout)
public NodeConnectionStatus requestNodeConnectionStatus(String hostname, int port)
ClusterCoordinationProtocolSenderrequestNodeConnectionStatus in interface ClusterCoordinationProtocolSenderpublic void notifyNodeStatusChange(Set<NodeIdentifier> nodesToNotify, NodeStatusChangeMessage msg)
ClusterCoordinationProtocolSendernotifyNodeStatusChange in interface ClusterCoordinationProtocolSendernodesToNotify - the nodes that should be notified of the changemsg - the message that indicates which node's status changed and what it changed toCopyright © 2016 Apache NiFi Project. All rights reserved.