Search in sources :

Example 1 with LookupService

use of org.apache.nifi.lookup.LookupService in project nifi by apache.

the class LookupAttribute method onTrigger.

@Override
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
    final ComponentLog logger = getLogger();
    final LookupService lookupService = context.getProperty(LOOKUP_SERVICE).asControllerService(LookupService.class);
    final boolean includeEmptyValues = context.getProperty(INCLUDE_EMPTY_VALUES).asBoolean();
    for (FlowFile flowFile : session.get(50)) {
        try {
            onTrigger(logger, lookupService, includeEmptyValues, flowFile, session);
        } catch (final IOException e) {
            throw new ProcessException(e.getMessage(), e);
        }
    }
}
Also used : FlowFile(org.apache.nifi.flowfile.FlowFile) ProcessException(org.apache.nifi.processor.exception.ProcessException) StringLookupService(org.apache.nifi.lookup.StringLookupService) LookupService(org.apache.nifi.lookup.LookupService) IOException(java.io.IOException) ComponentLog(org.apache.nifi.logging.ComponentLog)

Aggregations

IOException (java.io.IOException)1 FlowFile (org.apache.nifi.flowfile.FlowFile)1 ComponentLog (org.apache.nifi.logging.ComponentLog)1 LookupService (org.apache.nifi.lookup.LookupService)1 StringLookupService (org.apache.nifi.lookup.StringLookupService)1 ProcessException (org.apache.nifi.processor.exception.ProcessException)1