Search in sources :

Example 1 with OnDisabled

use of org.apache.nifi.annotation.lifecycle.OnDisabled in project kylo by Teradata.

the class MetadataProviderSelectorService method onDisabled.

@OnDisabled
public void onDisabled(final ConfigurationContext context) {
    getSpringContextService(context).ifPresent(springService -> {
        CancelActiveWaterMarkEventConsumer waterMarkConsumer = springService.getBean(CancelActiveWaterMarkEventConsumer.class);
        waterMarkConsumer.removeMetadataRecorder(this.recorder);
        FeedInitializationChangeEventConsumer initChangeConsumer = springService.getBean(FeedInitializationChangeEventConsumer.class);
        initChangeConsumer.addMetadataRecorder(this.recorder);
    });
}
Also used : FeedInitializationChangeEventConsumer(com.thinkbiganalytics.nifi.v2.core.feedinit.FeedInitializationChangeEventConsumer) CancelActiveWaterMarkEventConsumer(com.thinkbiganalytics.nifi.v2.core.watermark.CancelActiveWaterMarkEventConsumer) OnDisabled(org.apache.nifi.annotation.lifecycle.OnDisabled)

Example 2 with OnDisabled

use of org.apache.nifi.annotation.lifecycle.OnDisabled in project nifi by apache.

the class LivySessionController method shutdown.

@OnDisabled
public void shutdown() {
    ComponentLog log = getLogger();
    try {
        enabled = false;
        livySessionManagerThread.interrupt();
        livySessionManagerThread.join();
    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        log.error("Livy Session Manager Thread interrupted");
    }
}
Also used : ComponentLog(org.apache.nifi.logging.ComponentLog) OnDisabled(org.apache.nifi.annotation.lifecycle.OnDisabled)

Aggregations

OnDisabled (org.apache.nifi.annotation.lifecycle.OnDisabled)2 FeedInitializationChangeEventConsumer (com.thinkbiganalytics.nifi.v2.core.feedinit.FeedInitializationChangeEventConsumer)1 CancelActiveWaterMarkEventConsumer (com.thinkbiganalytics.nifi.v2.core.watermark.CancelActiveWaterMarkEventConsumer)1 ComponentLog (org.apache.nifi.logging.ComponentLog)1