Package org.apache.nifi.cluster.protocol
Interface NodeProtocolSender
- All Known Implementing Classes:
AbstractNodeProtocolSender
,LeaderElectionNodeProtocolSender
,NodeProtocolSenderListener
public interface NodeProtocolSender
An interface for sending protocol messages from a node to the cluster
manager.
-
Method Summary
Modifier and TypeMethodDescriptionSends a "cluster workflow request" message to the Cluster Coordinator.heartbeat
(HeartbeatMessage msg, String address) Sends a heartbeat to the address givenrequestConnection
(ConnectionRequestMessage msg, boolean allowConnectionToSelf) Sends a "connection request" message to the cluster manager.
-
Method Details
-
requestConnection
ConnectionResponseMessage requestConnection(ConnectionRequestMessage msg, boolean allowConnectionToSelf) throws ProtocolException, UnknownServiceAddressException Sends a "connection request" message to the cluster manager.- Parameters:
msg
- a messageallowConnectionToSelf
- whether or not the node should be allowed to connect to the cluster if the Cluster Coordinator is this node- Returns:
- the response
- Throws:
UnknownServiceAddressException
- if the cluster manager's address is not knownProtocolException
- if communication failed
-
heartbeat
Sends a heartbeat to the address given- Parameters:
msg
- the heartbeat message to sendaddress
- the address of the Cluster Coordinator in <hostname>:<port> format- Returns:
- the response from the Cluster Coordinator
- Throws:
ProtocolException
- if unable to send the heartbeat
-
clusterWorkload
ClusterWorkloadResponseMessage clusterWorkload(ClusterWorkloadRequestMessage msg) throws ProtocolException Sends a "cluster workflow request" message to the Cluster Coordinator.- Parameters:
msg
- a request message- Returns:
- the response from the Cluster Coordinator
- Throws:
ProtocolException
- if communication failed
-