Search in sources :

Example 1 with EventDrivenSourceRunner

use of org.apache.flume.source.EventDrivenSourceRunner in project nifi by apache.

the class ExecuteFlumeSource method stopped.

@OnStopped
public void stopped() {
    if (source instanceof PollableSource) {
        source.stop();
    } else {
        EventDrivenSourceRunner runner = runnerRef.get();
        if (runner != null) {
            runner.stop();
            runnerRef.compareAndSet(runner, null);
        }
        NifiSessionFactoryChannel eventDrivenSourceChannel = eventDrivenSourceChannelRef.get();
        if (eventDrivenSourceChannel != null) {
            eventDrivenSourceChannel.stop();
            eventDrivenSourceChannelRef.compareAndSet(eventDrivenSourceChannel, null);
        }
    }
    sessionFactoryRef.set(null);
}
Also used : EventDrivenSourceRunner(org.apache.flume.source.EventDrivenSourceRunner) PollableSource(org.apache.flume.PollableSource) OnStopped(org.apache.nifi.annotation.lifecycle.OnStopped)

Aggregations

PollableSource (org.apache.flume.PollableSource)1 EventDrivenSourceRunner (org.apache.flume.source.EventDrivenSourceRunner)1 OnStopped (org.apache.nifi.annotation.lifecycle.OnStopped)1