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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to