[ 
https://issues.apache.org/jira/browse/NIFI-4644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16270936#comment-16270936
 ] 

ASF GitHub Bot commented on NIFI-4644:
--------------------------------------

Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2304#discussion_r153818651
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/maxmind/IPLookupService.java
 ---
    @@ -237,8 +237,8 @@ public void closeReader() throws IOException {
             }
         }
     
    -    private Optional<Record> doLookup(final DatabaseReader databaseReader, 
final Map<String, String> coordinates) throws LookupFailureException, 
InvalidDatabaseException {
    -        final String ipAddress = coordinates.get(IP_KEY);
    +    private Optional<Record> doLookup(final DatabaseReader databaseReader, 
final Map<String, Object> coordinates) throws LookupFailureException, 
InvalidDatabaseException {
    +        final String ipAddress = coordinates.get(IP_KEY) instanceof String 
? (String)coordinates.get(IP_KEY) : coordinates.get(IP_KEY).toString();
    --- End diff --
    
    Again, no need to check instanceof here - can just call toString()


> LookupService should support more than String,String key value pairs
> --------------------------------------------------------------------
>
>                 Key: NIFI-4644
>                 URL: https://issues.apache.org/jira/browse/NIFI-4644
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Mike Thomsen
>            Assignee: Mike Thomsen
>
> The current interface is:
> {code:java}
> T lookup(Map<String, String> coordinates)
> {code}
> Limiting that to String, String has already caused problems for people using 
> the MongoDBLookupService. For example, a user wanting to do a lookup using a 
> String/Integer combination will find that the type is converted to 
> String/String automatically and it will fail against any data source that 
> cannot automatically make that conversion.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to