use of org.apache.nifi.cluster.protocol.NodeProtocolSender in project nifi by apache.
the class NodeClusterCoordinatorFactoryBean method getObject.
@Override
public NodeClusterCoordinator getObject() throws Exception {
if (nodeClusterCoordinator == null && properties.isNode()) {
final ClusterCoordinationProtocolSenderListener protocolSenderListener = applicationContext.getBean("clusterCoordinationProtocolSenderListener", ClusterCoordinationProtocolSenderListener.class);
final EventReporter eventReporter = applicationContext.getBean("eventReporter", EventReporter.class);
final ClusterNodeFirewall clusterFirewall = applicationContext.getBean("clusterFirewall", ClusterNodeFirewall.class);
final RevisionManager revisionManager = applicationContext.getBean("revisionManager", RevisionManager.class);
final LeaderElectionManager electionManager = applicationContext.getBean("leaderElectionManager", LeaderElectionManager.class);
final FlowElection flowElection = applicationContext.getBean("flowElection", FlowElection.class);
final NodeProtocolSender nodeProtocolSender = applicationContext.getBean("nodeProtocolSender", NodeProtocolSender.class);
nodeClusterCoordinator = new NodeClusterCoordinator(protocolSenderListener, eventReporter, electionManager, flowElection, clusterFirewall, revisionManager, properties, nodeProtocolSender);
}
return nodeClusterCoordinator;
}
use of org.apache.nifi.cluster.protocol.NodeProtocolSender in project nifi by apache.
the class Node method createNodeProtocolSender.
@SuppressWarnings("unchecked")
private NodeProtocolSender createNodeProtocolSender() {
final SocketConfiguration socketConfig = new SocketConfiguration();
socketConfig.setSocketTimeout(3000);
socketConfig.setReuseAddress(true);
final ProtocolContext<ProtocolMessage> protocolContext = new JaxbProtocolContext<>(JaxbProtocolUtils.JAXB_CONTEXT);
final NodeProtocolSender protocolSender = new LeaderElectionNodeProtocolSender(socketConfig, protocolContext, electionManager);
return protocolSender;
}
use of org.apache.nifi.cluster.protocol.NodeProtocolSender in project nifi by apache.
the class FlowControllerFactoryBean method getObject.
@Override
public Object getObject() throws Exception {
if (flowController == null) {
final FlowFileEventRepository flowFileEventRepository = applicationContext.getBean("flowFileEventRepository", FlowFileEventRepository.class);
if (properties.isNode()) {
final NodeProtocolSender nodeProtocolSender = applicationContext.getBean("nodeProtocolSender", NodeProtocolSender.class);
final HeartbeatMonitor heartbeatMonitor = applicationContext.getBean("heartbeatMonitor", HeartbeatMonitor.class);
flowController = FlowController.createClusteredInstance(flowFileEventRepository, properties, authorizer, auditService, encryptor, nodeProtocolSender, bulletinRepository, clusterCoordinator, heartbeatMonitor, leaderElectionManager, variableRegistry, flowRegistryClient);
} else {
flowController = FlowController.createStandaloneInstance(flowFileEventRepository, properties, authorizer, auditService, encryptor, bulletinRepository, variableRegistry, flowRegistryClient);
}
}
return flowController;
}
Aggregations