public abstract class AbstractNodeProtocolSender extends Object implements NodeProtocolSender
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
logger |
private ProtocolContext<ProtocolMessage> |
protocolContext |
private SocketConfiguration |
socketConfiguration |
| Constructor and Description |
|---|
AbstractNodeProtocolSender(SocketConfiguration socketConfiguration,
ProtocolContext<ProtocolMessage> protocolContext) |
| Modifier and Type | Method and Description |
|---|---|
ClusterWorkloadResponseMessage |
clusterWorkload(ClusterWorkloadRequestMessage msg)
Sends a "cluster workflow request" message to the Cluster Coordinator.
|
private Socket |
createSocket(InetSocketAddress socketAddress) |
protected abstract InetSocketAddress |
getServiceAddress() |
SocketConfiguration |
getSocketConfiguration() |
HeartbeatResponseMessage |
heartbeat(HeartbeatMessage msg,
String address)
Sends a heartbeat to the address given
|
ConnectionResponseMessage |
requestConnection(ConnectionRequestMessage msg,
boolean allowConnectToSelf)
Sends a "connection request" message to the cluster manager.
|
private ProtocolMessage |
sendProtocolMessage(ProtocolMessage msg,
String hostname,
int port) |
private void |
validateNotConnectingToSelf(ConnectionRequestMessage msg,
InetSocketAddress socketAddress) |
private static final org.slf4j.Logger logger
private final SocketConfiguration socketConfiguration
private final ProtocolContext<ProtocolMessage> protocolContext
public AbstractNodeProtocolSender(SocketConfiguration socketConfiguration, ProtocolContext<ProtocolMessage> protocolContext)
public ConnectionResponseMessage requestConnection(ConnectionRequestMessage msg, boolean allowConnectToSelf) throws ProtocolException, UnknownServiceAddressException
NodeProtocolSenderrequestConnection in interface NodeProtocolSendermsg - a messageallowConnectToSelf - whether or not the node should be allowed to connect to the cluster if the Cluster Coordinator is this nodeProtocolException - if communication failedUnknownServiceAddressException - if the cluster manager's address
is not knownprivate void validateNotConnectingToSelf(ConnectionRequestMessage msg, InetSocketAddress socketAddress)
public HeartbeatResponseMessage heartbeat(HeartbeatMessage msg, String address) throws ProtocolException
NodeProtocolSenderheartbeat in interface NodeProtocolSendermsg - the heartbeat message to sendaddress - the address of the Cluster Coordinator in <hostname>:<port> formatProtocolException - if unable to send the heartbeatpublic ClusterWorkloadResponseMessage clusterWorkload(ClusterWorkloadRequestMessage msg) throws ProtocolException
NodeProtocolSenderclusterWorkload in interface NodeProtocolSendermsg - a request messageProtocolException - if communication failedprivate Socket createSocket(InetSocketAddress socketAddress)
public SocketConfiguration getSocketConfiguration()
private ProtocolMessage sendProtocolMessage(ProtocolMessage msg, String hostname, int port)
protected abstract InetSocketAddress getServiceAddress() throws IOException
IOExceptionCopyright © 2021 Apache NiFi Project. All rights reserved.