Search in sources :

Example 1 with FeedPreconditionEventService

use of com.thinkbiganalytics.nifi.core.api.precondition.FeedPreconditionEventService in project kylo by Teradata.

the class BeginFeed method ensurePreconditonListener.

private void ensurePreconditonListener(ProcessContext context, Feed feed, String[] dsNames) {
    if (this.preconditionListener == null) {
        MetadataProvider provider = getProviderService(context).getProvider();
        FeedPreconditionEventService precondService = getPreconditionService(context);
        PreconditionListener listener = new PreconditionListener() {

            @Override
            public void triggered(FeedPreconditionTriggerEvent event) {
                getLog().debug("Precondition event triggered: ", new Object[] { event });
                BeginFeed.this.pendingChanges.add(event);
            }
        };
        for (String dsName : dsNames) {
            getLog().debug("Adding precondition listener for datasoure name: " + dsName);
            precondService.addListener("", dsName, listener);
        }
        this.preconditionListener = listener;
    }
}
Also used : PreconditionListener(com.thinkbiganalytics.nifi.core.api.precondition.PreconditionListener) FeedPreconditionTriggerEvent(com.thinkbiganalytics.metadata.rest.model.event.FeedPreconditionTriggerEvent) MetadataProvider(com.thinkbiganalytics.nifi.core.api.metadata.MetadataProvider) FeedPreconditionEventService(com.thinkbiganalytics.nifi.core.api.precondition.FeedPreconditionEventService)

Example 2 with FeedPreconditionEventService

use of com.thinkbiganalytics.nifi.core.api.precondition.FeedPreconditionEventService in project kylo by Teradata.

the class TriggerFeed method registerPreconditionListener.

private void registerPreconditionListener(ProcessContext context, String category, String feedName) {
    FeedPreconditionEventService precondService = getPreconditionService(context);
    precondService.addListener(category, feedName, preconditionListener);
}
Also used : FeedPreconditionEventService(com.thinkbiganalytics.nifi.core.api.precondition.FeedPreconditionEventService)

Aggregations

FeedPreconditionEventService (com.thinkbiganalytics.nifi.core.api.precondition.FeedPreconditionEventService)2 FeedPreconditionTriggerEvent (com.thinkbiganalytics.metadata.rest.model.event.FeedPreconditionTriggerEvent)1 MetadataProvider (com.thinkbiganalytics.nifi.core.api.metadata.MetadataProvider)1 PreconditionListener (com.thinkbiganalytics.nifi.core.api.precondition.PreconditionListener)1