[
https://issues.apache.org/jira/browse/NIFI-3946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16019553#comment-16019553
]
ASF GitHub Bot commented on NIFI-3946:
--------------------------------------
Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1833#discussion_r117738594
--- Diff:
nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/maxmind/IPLookupService.java
---
@@ -146,17 +153,27 @@ public void closeReader() throws IOException {
}
@Override
- public Optional<Record> lookup(final String key) throws
LookupFailureException {
- if (key == null) {
+ public Set<String> getRequiredKeys() {
+ return REQUIRED_KEYS;
+ }
+
+ @Override
+ public Optional<Record> lookup(final Map<String, String> coordinates)
throws LookupFailureException {
+ if (coordinates == null) {
return Optional.empty();
}
+ final String ipAddress = coordinates.get(IP_KEY);
+ if (ipAddress == null) {
+ return null;
--- End diff --
Yes, definitely. Good catch!
> Should update LookupRecord to allow multi criteria lookups
> ----------------------------------------------------------
>
> Key: NIFI-3946
> URL: https://issues.apache.org/jira/browse/NIFI-3946
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Joseph Witt
> Assignee: Mark Payne
>
> At present the LookupRecord processor allows a single criteria lookup.
> We need to provide a lookup API which takes a map of string key/values that a
> given lookup can use when searching for the result. The LookupRecord
> processor should change such that all dynamic properties are the loookup key
> names with values that are the RecordPath to find the value for that given
> key. The resulting map would be passed to the lookup service. Also the lookup
> service API should allow returning the set of required key names so that the
> processor can validate once all required keys have RecordPaths to search for
> values.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)