[
https://issues.apache.org/jira/browse/NIFI-3404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16019262#comment-16019262
]
ASF GitHub Bot commented on NIFI-3404:
--------------------------------------
Github user ijokarumawak commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1830#discussion_r117681251
--- Diff:
nifi-nar-bundles/nifi-standard-services/nifi-lookup-service-api/src/main/java/org/apache/nifi/lookup/LookupService.java
---
@@ -17,25 +17,47 @@
package org.apache.nifi.lookup;
+import java.util.Map;
import java.util.Optional;
+import java.util.Set;
import org.apache.nifi.controller.ControllerService;
public interface LookupService<T> extends ControllerService {
/**
- * Looks up a value that corresponds to the given key
+ * Looks up a value that corresponds to the given map of information,
referred to as lookup coordinates
*
- * @param key the key to lookup
- * @return a value that corresponds to the given key
+ * @param coordinates a Map of key/value pairs that indicate the
information that should be looked up
+ * @return a value that corresponds to the given coordinates
*
- * @throws LookupFailureException if unable to lookup a value for the
given key
+ * @throws LookupFailureException if unable to lookup a value for the
given coordinates
*/
- Optional<T> lookup(String key) throws LookupFailureException;
+ Optional<T> lookup(Map<String, String> coordinates) throws
LookupFailureException;
/**
- * @return the Class that represents the type of value that will be
returned by {@link #lookup(String)}
+ * Returns the entire lookup table as a {@link Map}
+ *
+ * @return the lookup table stored in the backing service
+ * @throws LookupFailureException if the backing service is
unavailable or
+ * the table cannot be loaded
+ */
+ default Map<String, T> asMap() throws LookupFailureException {
--- End diff --
Returning entire lookup table as a Map would cause issue with a large
number of entries. I think this should be avoided.
> Add lookup processor for enrichments/joins to reference data
> ------------------------------------------------------------
>
> Key: NIFI-3404
> URL: https://issues.apache.org/jira/browse/NIFI-3404
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Joey Frazee
> Assignee: Joey Frazee
>
> NiFi doesn't currently have an easy, concise way of doing enrichment, joining
> against reference data sets or performing attribute lookups against external
> data sources.
> Since enrichments and joins are basic streaming use cases, and since
> attributes and EL are often used to parameterize processor properties, there
> is a need for an easy way to do enrichments, joins and lookups without having
> to write code or create a lengthy data flow.
> There's been some discussion of this on the mailing list [1] and I've started
> work on a LookupAttribute [2] processor that delegates the work to controller
> services.
> 1.
> https://lists.apache.org/thread.html/74321ff0e9e0b7339e43ad53b36119315dc5094991605edfb12b34d0@%3Cdev.nifi.apache.org%3E
> 2. https://github.com/jfrazee/nifi-lookup-service
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)