Search in sources :

Example 1 with NodeProtocolSender

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;
}
Also used : NodeProtocolSender(org.apache.nifi.cluster.protocol.NodeProtocolSender) LeaderElectionManager(org.apache.nifi.controller.leader.election.LeaderElectionManager) NodeClusterCoordinator(org.apache.nifi.cluster.coordination.node.NodeClusterCoordinator) ClusterNodeFirewall(org.apache.nifi.cluster.firewall.ClusterNodeFirewall) RevisionManager(org.apache.nifi.web.revision.RevisionManager) FlowElection(org.apache.nifi.cluster.coordination.flow.FlowElection) ClusterCoordinationProtocolSenderListener(org.apache.nifi.cluster.protocol.impl.ClusterCoordinationProtocolSenderListener) EventReporter(org.apache.nifi.events.EventReporter)

Example 2 with NodeProtocolSender

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;
}
Also used : LeaderElectionNodeProtocolSender(org.apache.nifi.cluster.coordination.node.LeaderElectionNodeProtocolSender) NodeProtocolSender(org.apache.nifi.cluster.protocol.NodeProtocolSender) LeaderElectionNodeProtocolSender(org.apache.nifi.cluster.coordination.node.LeaderElectionNodeProtocolSender) SocketConfiguration(org.apache.nifi.io.socket.SocketConfiguration) ServerSocketConfiguration(org.apache.nifi.io.socket.ServerSocketConfiguration) JaxbProtocolContext(org.apache.nifi.cluster.protocol.jaxb.JaxbProtocolContext) ProtocolMessage(org.apache.nifi.cluster.protocol.message.ProtocolMessage)

Example 3 with NodeProtocolSender

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;
}
Also used : HeartbeatMonitor(org.apache.nifi.cluster.coordination.heartbeat.HeartbeatMonitor) FlowFileEventRepository(org.apache.nifi.controller.repository.FlowFileEventRepository) NodeProtocolSender(org.apache.nifi.cluster.protocol.NodeProtocolSender)

Aggregations

NodeProtocolSender (org.apache.nifi.cluster.protocol.NodeProtocolSender)3 FlowElection (org.apache.nifi.cluster.coordination.flow.FlowElection)1 HeartbeatMonitor (org.apache.nifi.cluster.coordination.heartbeat.HeartbeatMonitor)1 LeaderElectionNodeProtocolSender (org.apache.nifi.cluster.coordination.node.LeaderElectionNodeProtocolSender)1 NodeClusterCoordinator (org.apache.nifi.cluster.coordination.node.NodeClusterCoordinator)1 ClusterNodeFirewall (org.apache.nifi.cluster.firewall.ClusterNodeFirewall)1 ClusterCoordinationProtocolSenderListener (org.apache.nifi.cluster.protocol.impl.ClusterCoordinationProtocolSenderListener)1 JaxbProtocolContext (org.apache.nifi.cluster.protocol.jaxb.JaxbProtocolContext)1 ProtocolMessage (org.apache.nifi.cluster.protocol.message.ProtocolMessage)1 LeaderElectionManager (org.apache.nifi.controller.leader.election.LeaderElectionManager)1 FlowFileEventRepository (org.apache.nifi.controller.repository.FlowFileEventRepository)1 EventReporter (org.apache.nifi.events.EventReporter)1 ServerSocketConfiguration (org.apache.nifi.io.socket.ServerSocketConfiguration)1 SocketConfiguration (org.apache.nifi.io.socket.SocketConfiguration)1 RevisionManager (org.apache.nifi.web.revision.RevisionManager)1