Search in sources :

Example 1 with ThreadPoolRequestReplicator

use of org.apache.nifi.cluster.coordination.http.replication.ThreadPoolRequestReplicator in project nifi by apache.

the class ThreadPoolRequestReplicatorFactoryBean method getObject.

@Override
public ThreadPoolRequestReplicator getObject() throws Exception {
    if (replicator == null && nifiProperties.isNode()) {
        final EventReporter eventReporter = applicationContext.getBean("eventReporter", EventReporter.class);
        final ClusterCoordinator clusterCoordinator = applicationContext.getBean("clusterCoordinator", ClusterCoordinator.class);
        final RequestCompletionCallback requestCompletionCallback = applicationContext.getBean("clusterCoordinator", RequestCompletionCallback.class);
        final int corePoolSize = nifiProperties.getClusterNodeProtocolCorePoolSize();
        final int maxPoolSize = nifiProperties.getClusterNodeProtocolMaxPoolSize();
        final int maxConcurrentRequests = nifiProperties.getClusterNodeMaxConcurrentRequests();
        final Client jerseyClient = WebUtils.createClient(null, SslContextFactory.createSslContext(nifiProperties));
        final String connectionTimeout = nifiProperties.getClusterNodeConnectionTimeout();
        final String readTimeout = nifiProperties.getClusterNodeReadTimeout();
        replicator = new ThreadPoolRequestReplicator(corePoolSize, maxPoolSize, maxConcurrentRequests, jerseyClient, clusterCoordinator, connectionTimeout, readTimeout, requestCompletionCallback, eventReporter, nifiProperties);
    }
    return replicator;
}
Also used : ClusterCoordinator(org.apache.nifi.cluster.coordination.ClusterCoordinator) Client(javax.ws.rs.client.Client) ThreadPoolRequestReplicator(org.apache.nifi.cluster.coordination.http.replication.ThreadPoolRequestReplicator) RequestCompletionCallback(org.apache.nifi.cluster.coordination.http.replication.RequestCompletionCallback) EventReporter(org.apache.nifi.events.EventReporter)

Aggregations

Client (javax.ws.rs.client.Client)1 ClusterCoordinator (org.apache.nifi.cluster.coordination.ClusterCoordinator)1 RequestCompletionCallback (org.apache.nifi.cluster.coordination.http.replication.RequestCompletionCallback)1 ThreadPoolRequestReplicator (org.apache.nifi.cluster.coordination.http.replication.ThreadPoolRequestReplicator)1 EventReporter (org.apache.nifi.events.EventReporter)1